Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8a038b2

Browse files
committed
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. ........
1 parent 606bbc9 commit 8a038b2

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

Lib/pdb.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,8 +1210,9 @@ def _runscript(self, filename):
12101210
self._wait_for_mainpyfile = 1
12111211
self.mainpyfile = self.canonic(filename)
12121212
self._user_requested_quit = 0
1213-
with open(filename) as fp:
1214-
statement = "exec(%r)" % (fp.read(),)
1213+
with open(filename, "rb") as fp:
1214+
statement = "exec(compile(%r, %r, 'exec'))" % \
1215+
(fp.read(), self.mainpyfile)
12151216
self.run(statement)
12161217

12171218
# Simplified interface

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ C-API
4242
Library
4343
-------
4444

45+
- Issue #6126: Fixed pdb command-line usage.
46+
4547
- Issue #6629: Fix a data corruption issue in the new I/O library, which could
4648
occur when writing to a BufferedRandom object (e.g. a file opened in "rb+" or
4749
"wb+" mode) after having buffered a certain amount of data for reading. This

0 commit comments

Comments
 (0)