diff options
author | Georg Brandl <georg@python.org> | 2009-08-13 07:50:57 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-08-13 07:50:57 (GMT) |
commit | d07ac6402422abbc54215478e042bbb009148cf9 (patch) | |
tree | c3958071e5de463401eb97c34609b39a76b8e075 /Lib | |
parent | 019f3617f8e5c667c4db3182ead37f2c1fbb0268 (diff) | |
download | cpython-d07ac6402422abbc54215478e042bbb009148cf9.zip cpython-d07ac6402422abbc54215478e042bbb009148cf9.tar.gz cpython-d07ac6402422abbc54215478e042bbb009148cf9.tar.bz2 |
#6126: fix pdb stepping and breakpoints by giving the executed code the correct filename; this used execfile() in 2.x which did this automatically.
Diffstat (limited to 'Lib')
-rwxr-xr-x | Lib/pdb.py | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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 |