mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +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
|
@ -180,7 +180,12 @@ def main():
|
|||
|
||||
if (len(sys.argv) > 0):
|
||||
sys.path.insert(0, os.path.dirname(sys.argv[0]))
|
||||
run('execfile(%r)' % (sys.argv[0],), options.outfile, options.sort)
|
||||
fp = open(sys.argv[0])
|
||||
try:
|
||||
script = fp.read()
|
||||
finally:
|
||||
fp.close()
|
||||
run('exec(%r)' % script, options.outfile, options.sort)
|
||||
else:
|
||||
parser.print_usage()
|
||||
return parser
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue