Kaydet (Commit) a050171e authored tarafından Raymond Hettinger's avatar Raymond Hettinger

SF bug #973092: inspect.getframeinfo bug if 'context' is to big

Make sure the start argument is not negative.
üst 40333cee
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment