aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/ipython/py3/patches/04-fix-context-lines-and-lines-cmd.patch
blob: a25eb8752c6af00c67a697336300b773fc1a4b73 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--- contrib/python/ipython/py3/IPython/core/debugger.py	(revision 12930657)
+++ contrib/python/ipython/py3/IPython/core/debugger.py	(working copy)
@@ -616,7 +616,7 @@
         ret.append("%s(%s)%s\n" % (link, lineno, call))
 
         start = lineno - 1 - context//2
-        lines = linecache.getlines(filename)
+        lines = linecache.getlines(filename, frame.f_globals)
         start = min(start, len(lines) - context)
         start = max(start, 0)
         lines = lines[start : start + context]
@@ -674,7 +674,7 @@
                 filename = self._exec_filename
 
             for lineno in range(first, last+1):
-                line = linecache.getline(filename, lineno)
+                line = linecache.getline(filename, lineno, self.curframe.f_globals)
                 if not line:
                     break