From ff0e3b7a54673791bb724be9679c85a4feb7468c Mon Sep 17 00:00:00 2001 From: Berker Peksag Date: Mon, 2 Jan 2017 06:57:43 +0300 Subject: Issue #15812: inspect.getframeinfo() now correctly shows the first line of a context Patch by Sam Breese. --- Lib/inspect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Lib/inspect.py') 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 -- cgit v1.2.1