catch IndexError exceptions when getting exception source location
This commit is contained in:
committed by
Ryan Wooden
parent
310bada6f5
commit
cf9a09e988
@@ -1774,7 +1774,7 @@ class FixtureLookupError(LookupError):
|
||||
fspath, lineno = getfslineno(function)
|
||||
try:
|
||||
lines, _ = inspect.getsourcelines(get_real_func(function))
|
||||
except IOError:
|
||||
except (IOError, IndexError):
|
||||
error_msg = "file %s, line %s: source code not available"
|
||||
addline(error_msg % (fspath, lineno+1))
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user