mirror of
https://github.com/python/cpython.git
synced 2025-08-22 01:35:16 +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
|
@ -773,7 +773,12 @@ def main(argv=None):
|
|||
ignoredirs=ignore_dirs, infile=counts_file,
|
||||
outfile=counts_file)
|
||||
try:
|
||||
t.run('execfile(%r)' % (progname,))
|
||||
fp = open(progname)
|
||||
try:
|
||||
script = fp.read()
|
||||
finally:
|
||||
fp.close()
|
||||
t.run('exec(%r)' % (script,))
|
||||
except IOError as err:
|
||||
_err_exit("Cannot run file %r because: %s" % (sys.argv[0], err))
|
||||
except SystemExit:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue