diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2007-08-12 00:43:29 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2007-08-12 00:43:29 (GMT) |
commit | 016880229a369a3fb419f3eed28b6db7c342fe71 (patch) | |
tree | 9b11de5c197bc556dd515e035327673765cd4871 /Lib/trace.py | |
parent | 41eaedd3613cebc83e6b9925499369992c7a7770 (diff) | |
download | cpython-016880229a369a3fb419f3eed28b6db7c342fe71.zip cpython-016880229a369a3fb419f3eed28b6db7c342fe71.tar.gz cpython-016880229a369a3fb419f3eed28b6db7c342fe71.tar.bz2 |
Kill execfile(), use exec() instead
Diffstat (limited to 'Lib/trace.py')
-rw-r--r-- | Lib/trace.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/trace.py b/Lib/trace.py index d40f13c..645517a 100644 --- a/Lib/trace.py +++ b/Lib/trace.py @@ -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: |