Kill execfile(), use exec() instead

This commit is contained in:
Neal Norwitz 2007-08-12 00:43:29 +00:00
parent 41eaedd361
commit 016880229a
98 changed files with 179 additions and 341 deletions

View file

@ -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