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

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