diff options
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: |