mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Kill execfile(), use exec() instead
This commit is contained in:
parent
41eaedd361
commit
016880229a
98 changed files with 179 additions and 341 deletions
|
@ -1164,7 +1164,12 @@ see no sign that the breakpoint was reached.
|
|||
self._wait_for_mainpyfile = 1
|
||||
self.mainpyfile = self.canonic(filename)
|
||||
self._user_requested_quit = 0
|
||||
statement = 'execfile( "%s")' % filename
|
||||
fp = open(filename)
|
||||
try:
|
||||
script = fp.read()
|
||||
finally:
|
||||
fp.close()
|
||||
statement = 'exec("%s")' % script
|
||||
self.run(statement)
|
||||
|
||||
# Simplified interface
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue