diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2017-01-02 06:57:43 +0300 |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2017-01-02 06:57:43 +0300 |
commit | ff0e3b7a54673791bb724be9679c85a4feb7468c (patch) | |
tree | 49262a5fc0179eeae9a8abd85e24ccf02a382912 /Lib/inspect.py | |
parent | 4950ae14916e340e5274ce0b8277aec9006bd035 (diff) | |
download | cpython-git-ff0e3b7a54673791bb724be9679c85a4feb7468c.tar.gz |
Issue #15812: inspect.getframeinfo() now correctly shows the first line of a context
Patch by Sam Breese.
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 e6dae1e048..6b9e0b00b5 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -1416,7 +1416,7 @@ def getframeinfo(frame, context=1): except OSError: lines = index = None else: - start = max(start, 1) + start = max(start, 0) start = max(0, min(start, len(lines) - context)) lines = lines[start:start+context] index = lineno - 1 - start |