Commit 50da60cc authored by Georg Brandl's avatar Georg Brandl

The final occurrences of exception slicing.

parent d11b68ab
...@@ -617,8 +617,8 @@ if __name__ == '__main__': ...@@ -617,8 +617,8 @@ if __name__ == '__main__':
if line: if line:
try: try:
self.stats = Stats(line) self.stats = Stats(line)
except IOError as args: except IOError as err:
print(args[1], file=self.stream) print(err.args[1], file=self.stream)
return return
self.prompt = line + "% " self.prompt = line + "% "
elif len(self.prompt) > 2: elif len(self.prompt) > 2:
......
...@@ -157,7 +157,7 @@ class OtherFileTests(unittest.TestCase): ...@@ -157,7 +157,7 @@ class OtherFileTests(unittest.TestCase):
s = str(msg) s = str(msg)
if s.find(TESTFN) != -1 or s.find(bad_mode) == -1: if s.find(TESTFN) != -1 or s.find(bad_mode) == -1:
self.fail("bad error message for invalid mode: %s" % s) self.fail("bad error message for invalid mode: %s" % s)
# if msg[0] == 0, we're probably on Windows where there may be # if msg.args[0] == 0, we're probably on Windows where there may be
# no obvious way to discover why open() failed. # no obvious way to discover why open() failed.
else: else:
f.close() f.close()
......
...@@ -172,7 +172,7 @@ class OtherFileTests(unittest.TestCase): ...@@ -172,7 +172,7 @@ class OtherFileTests(unittest.TestCase):
s = str(msg) s = str(msg)
if s.find(TESTFN) != -1 or s.find(bad_mode) == -1: if s.find(TESTFN) != -1 or s.find(bad_mode) == -1:
self.fail("bad error message for invalid mode: %s" % s) self.fail("bad error message for invalid mode: %s" % s)
# if msg[0] == 0, we're probably on Windows where there may be # if msg.args[0] == 0, we're probably on Windows where there may be
# no obvious way to discover why open() failed. # no obvious way to discover why open() failed.
else: else:
f.close() f.close()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment