]> granicus.if.org Git - python/commitdiff
Merged revisions 74366 via svnmerge from
authorGeorg Brandl <georg@python.org>
Thu, 13 Aug 2009 07:52:08 +0000 (07:52 +0000)
committerGeorg Brandl <georg@python.org>
Thu, 13 Aug 2009 07:52:08 +0000 (07:52 +0000)
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.
........

Lib/pdb.py
Misc/NEWS

index d379d1a9abd765f6977b2a842b1ac558c2e69cf4..e272f2ebb323e1604937645b7632ee484339fc98 100755 (executable)
@@ -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
index f412f725e5b77843f13fd58d0b6b54a3e0e19585..8c9bb93bbf50a1718aa94c7fe14ba4aa6c295ad1 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -42,6 +42,8 @@ C-API
 Library
 -------
 
+- Issue #6126: Fixed pdb command-line usage.
+
 - Issue #6629: Fix a data corruption issue in the new I/O library, which could
   occur when writing to a BufferedRandom object (e.g. a file opened in "rb+" or
   "wb+" mode) after having buffered a certain amount of data for reading. This