mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Repair a bad translation of the exec statement.
Fixes #1038: pdb command line invocation fails.
This commit is contained in:
parent
a00f123706
commit
7dd803a4d4
1 changed files with 2 additions and 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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue