diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-10-08 20:33:20 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-10-08 20:33:20 (GMT) |
commit | eaa6e3c7123525aa10a5e74c53d7210584e5aecc (patch) | |
tree | df169f9e12c296cbf68e9f9b3240668e00c4e9eb /Tools/scripts | |
parent | 168beada91a1cb70ed9186740dd1b689ca448bff (diff) | |
download | cpython-eaa6e3c7123525aa10a5e74c53d7210584e5aecc.zip cpython-eaa6e3c7123525aa10a5e74c53d7210584e5aecc.tar.gz cpython-eaa6e3c7123525aa10a5e74c53d7210584e5aecc.tar.bz2 |
Replace all instances of err.strerror with err.
The strerror attribute contained only partial information about the
exception and produced some very confusing error messages. By passing
err (the exception object itself) and letting it convert itself to a
string, the error messages are better.
Diffstat (limited to 'Tools/scripts')
-rw-r--r-- | Tools/scripts/trace.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Tools/scripts/trace.py b/Tools/scripts/trace.py index 35dc71f..14ccffd 100644 --- a/Tools/scripts/trace.py +++ b/Tools/scripts/trace.py @@ -353,7 +353,7 @@ def create_results_log(results, dirname = ".", show_missing = 1, lines = open(filename, 'r').readlines() except IOError, err: print >> sys.stderr, "trace: Could not open %s for reading " \ - "because: %s - skipping" % (`filename`, err.strerror) + "because: %s - skipping" % (`filename`, err) continue try: @@ -361,7 +361,7 @@ def create_results_log(results, dirname = ".", show_missing = 1, except IOError, err: sys.stderr.write( '%s: Could not open %s for writing because: %s" \ - "- skipping\n' % ("trace", `listfilename`, err.strerror)) + "- skipping\n' % ("trace", `listfilename`, err)) continue # If desired, get a list of the line numbers which represent @@ -416,7 +416,7 @@ def create_results_log(results, dirname = ".", show_missing = 1, open(os.path.join(dirname, "modules"), "w")) except IOError, err: sys.stderr.write("cannot save counts/modules " \ - "files because %s" % err.strerror) + "files because %s" % err) if summary and sums: mods = sums.keys() @@ -663,7 +663,7 @@ def main(argv = None): run(t.trace, 'execfile(' + `progname` + ')') except IOError, err: _err_exit("Cannot run file %s because: %s" % \ - (`sys.argv[0]`, err.strerror)) + (`sys.argv[0]`, err)) elif count: t = Coverage(ignore) @@ -671,7 +671,7 @@ def main(argv = None): run(t.trace, 'execfile(' + `progname` + ')') except IOError, err: _err_exit("Cannot run file %s because: %s" % \ - (`sys.argv[0]`, err.strerror)) + (`sys.argv[0]`, err)) except SystemExit: pass @@ -699,7 +699,7 @@ def main(argv = None): open(counts_file, 'wb')) except IOError, err: _err_exit("Cannot save counts file %s because: %s" % \ - (`counts_file`, err.strerror)) + (`counts_file`, err)) elif report: old_counts, old_modules = marshal.load(open(counts_file, 'rb')) |