SF bug #973092: inspect.getframeinfo bug if 'context' is to big
Make sure the start argument is not negative.
This commit is contained in:
parent
40333ceeac
commit
a050171ee9
|
@ -756,7 +756,7 @@ def getframeinfo(frame, context=1):
|
|||
lines = index = None
|
||||
else:
|
||||
start = max(start, 1)
|
||||
start = min(start, len(lines) - context)
|
||||
start = max(0, min(start, len(lines) - context))
|
||||
lines = lines[start:start+context]
|
||||
index = lineno - 1 - start
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue