diff options
author | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2010-07-21 17:50:34 (GMT) |
---|---|---|
committer | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2010-07-21 17:50:34 (GMT) |
commit | eeec92fd8abf5c5810f3e6d93178c7bbb5e479ec (patch) | |
tree | f0b8322e649437715b3bc0ffae58d9e8f04b34a2 | |
parent | 913c52edf31d2f14d076f5e3e7218d09a0934f4d (diff) | |
download | cpython-eeec92fd8abf5c5810f3e6d93178c7bbb5e479ec.zip cpython-eeec92fd8abf5c5810f3e6d93178c7bbb5e479ec.tar.gz cpython-eeec92fd8abf5c5810f3e6d93178c7bbb5e479ec.tar.bz2 |
Merged revisions 83035 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r83035 | alexander.belopolsky | 2010-07-21 13:43:42 -0400 (Wed, 21 Jul 2010) | 3 lines
Issue #9323: Fixed a bug in trace.py that resulted in loosing the name
of the script being traced. Patch by Eli Bendersky.
........
-rw-r--r-- | Lib/trace.py | 9 | ||||
-rw-r--r-- | Misc/NEWS | 3 | ||||
-rw-r--r-- | Misc/maintainers.rst | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/Lib/trace.py b/Lib/trace.py index c0cca9d..49ad7a8 100644 --- a/Lib/trace.py +++ b/Lib/trace.py @@ -797,12 +797,9 @@ def main(argv=None): ignoredirs=ignore_dirs, infile=counts_file, outfile=counts_file, timing=timing) try: - fp = open(progname) - try: - script = fp.read() - finally: - fp.close() - t.run('exec(%r)' % (script,)) + with open(progname) as fp: + code = compile(fp.read(), progname, 'exec') + t.run(code) except IOError as err: _err_exit("Cannot run file %r because: %s" % (sys.argv[0], err)) except SystemExit: @@ -78,6 +78,9 @@ C-API Library ------- +- Issue #9323: Fixed a bug in trace.py that resulted in loosing the + name of the script being traced. Patch by Eli Bendersky. + - Issue #9282: Fixed --listfuncs option of trace.py. Thanks Eli Bendersky for the patch. diff --git a/Misc/maintainers.rst b/Misc/maintainers.rst index 7795eb0..b9984b1 100644 --- a/Misc/maintainers.rst +++ b/Misc/maintainers.rst @@ -212,7 +212,7 @@ timeit tkinter gpolo token georg.brandl tokenize -trace +trace alexander.belopolsky traceback georg.brandl tty turtle gregorlingl |