Merged revisions 74366 via svnmerge from

svn+ssh://svn.python.org/python/branches/py3k

........
  r74366 | georg.brandl | 2009-08-13 09:50:57 +0200 (Do, 13 Aug 2009) | 1 line

  #6126: fix pdb stepping and breakpoints by giving the executed code the correct filename; this used execfile() in 2.x which did this automatically.
........
This commit is contained in:
Georg Brandl 2009-08-13 07:52:08 +00:00
parent 606bbc9b9f
commit 8a038b283b
2 changed files with 5 additions and 2 deletions

View file

@ -1210,8 +1210,9 @@ see no sign that the breakpoint was reached.
self._wait_for_mainpyfile = 1
self.mainpyfile = self.canonic(filename)
self._user_requested_quit = 0
with open(filename) as fp:
statement = "exec(%r)" % (fp.read(),)
with open(filename, "rb") as fp:
statement = "exec(compile(%r, %r, 'exec'))" % \
(fp.read(), self.mainpyfile)
self.run(statement)
# Simplified interface