summaryrefslogtreecommitdiffstats
path: root/Lib/trace.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/trace.py')
-rw-r--r--Lib/trace.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/trace.py b/Lib/trace.py
index c7ed0a5..ca44eae 100644
--- a/Lib/trace.py
+++ b/Lib/trace.py
@@ -220,7 +220,7 @@ class CoverageResults:
counts, calledfuncs, callers = \
pickle.load(open(self.infile, 'rb'))
self.update(self.__class__(counts, calledfuncs, callers))
- except (IOError, EOFError, ValueError), err:
+ except (IOError, EOFError, ValueError) as err:
print >> sys.stderr, ("Skipping counts file %r: %s"
% (self.infile, err))
@@ -328,7 +328,7 @@ class CoverageResults:
try:
pickle.dump((self.counts, self.calledfuncs, self.callers),
open(self.outfile, 'wb'), 1)
- except IOError, err:
+ except IOError as err:
print >> sys.stderr, "Can't save counts files because %s" % err
def write_results_file(self, path, lines, lnotab, lines_hit):
@@ -336,7 +336,7 @@ class CoverageResults:
try:
outfile = open(path, "w")
- except IOError, err:
+ except IOError as err:
print >> sys.stderr, ("trace: Could not open %r for writing: %s"
"- skipping" % (path, err))
return 0, 0
@@ -422,7 +422,7 @@ def find_executable_linenos(filename):
"""Return dict where keys are line numbers in the line number table."""
try:
prog = open(filename, "rU").read()
- except IOError, err:
+ except IOError as err:
print >> sys.stderr, ("Not printing coverage data for %r: %s"
% (filename, err))
return {}
@@ -658,7 +658,7 @@ def main(argv=None):
"coverdir=", "listfuncs",
"trackcalls"])
- except getopt.error, msg:
+ except getopt.error as msg:
sys.stderr.write("%s: %s\n" % (sys.argv[0], msg))
sys.stderr.write("Try `%s --help' for more information\n"
% sys.argv[0])
@@ -778,7 +778,7 @@ def main(argv=None):
outfile=counts_file)
try:
t.run('execfile(%r)' % (progname,))
- except IOError, err:
+ except IOError as err:
_err_exit("Cannot run file %r because: %s" % (sys.argv[0], err))
except SystemExit:
pass