--- contrib/python/ipython/py2/IPython/core/debugger.py (revision 12930657) +++ contrib/python/ipython/py2/IPython/core/debugger.py (working copy) @@ -408,7 +408,7 @@ ret.append(u'%s(%s)%s\n' % (link,lineno,call)) start = lineno - 1 - context//2 - lines = ulinecache.getlines(filename) + lines = ulinecache.getlines(filename, frame.f_globals) start = min(start, len(lines) - context) start = max(start, 0) lines = lines[start : start + context]