diff options
author | Georg Brandl <georg@python.org> | 2007-09-12 19:44:18 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2007-09-12 19:44:18 (GMT) |
commit | 7dd803a4d43f8c2a7b3aa69c8f934f8a497afc60 (patch) | |
tree | 4e9ed5e1f0c2a8427ebee35375c5fbc2810905fe /Lib/pdb.py | |
parent | a00f1237069233ac116c40c88ead2f5684629459 (diff) | |
download | cpython-7dd803a4d43f8c2a7b3aa69c8f934f8a497afc60.zip cpython-7dd803a4d43f8c2a7b3aa69c8f934f8a497afc60.tar.gz cpython-7dd803a4d43f8c2a7b3aa69c8f934f8a497afc60.tar.bz2 |
Repair a bad translation of the exec statement.
Fixes #1038: pdb command line invocation fails.
Diffstat (limited to 'Lib/pdb.py')
-rwxr-xr-x | Lib/pdb.py | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -1166,12 +1166,8 @@ see no sign that the breakpoint was reached. self._wait_for_mainpyfile = 1 self.mainpyfile = self.canonic(filename) self._user_requested_quit = 0 - fp = open(filename) - try: - script = fp.read() - finally: - fp.close() - statement = 'exec("%s")' % script + with open(filename) as fp: + statement = fp.read() self.run(statement) # Simplified interface |