Index: Lib/pdb.py =================================================================== --- Lib/pdb.py (revision 67006) +++ Lib/pdb.py (working copy) @@ -768,7 +768,7 @@ breaklist = self.get_file_breaks(filename) try: for lineno in range(first, last+1): - line = linecache.getline(filename, lineno) + line = linecache.getline(filename, lineno, self.curframe.f_globals) if not line: print >>self.stdout, '[EOF]' break Index: Lib/bdb.py =================================================================== --- Lib/bdb.py (revision 67006) +++ Lib/bdb.py (working copy) @@ -347,7 +347,7 @@ rv = frame.f_locals['__return__'] s = s + '->' s = s + repr.repr(rv) - line = linecache.getline(filename, lineno) + line = linecache.getline(filename, lineno, frame.f_globals) if line: s = s + lprefix + line.strip() return s