diff options
author | Raymond Hettinger <python@rcn.com> | 2004-06-15 11:22:53 +0000 |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2004-06-15 11:22:53 +0000 |
commit | deaedf163c8a2f2b32f5a7f600ffd3fe12e85c5b (patch) | |
tree | 56d36837ce421a2fa3800793e38ffb268ae881b7 /Lib/inspect.py | |
parent | 00faed3232e89c7b0d18769c3b07747be25f1344 (diff) | |
download | cpython-deaedf163c8a2f2b32f5a7f600ffd3fe12e85c5b.tar.gz |
SF bug #973092: inspect.getframeinfo bug if 'context' is to big
Make sure the start argument is not negative.
Diffstat (limited to 'Lib/inspect.py')
-rw-r--r-- | Lib/inspect.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py index 8a58ce9505..12c9cb757b 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -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: |