04-fix-context-lines-and-lines-cmd.patch 828 B

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