The final occurrences of exception slicing.

This commit is contained in:
Georg Brandl 2008-01-06 21:38:54 +00:00
parent d11b68ab08
commit 50da60cc5b
3 changed files with 4 additions and 4 deletions

View File

@ -617,8 +617,8 @@ if __name__ == '__main__':
if line:
try:
self.stats = Stats(line)
except IOError as args:
print(args[1], file=self.stream)
except IOError as err:
print(err.args[1], file=self.stream)
return
self.prompt = line + "% "
elif len(self.prompt) > 2:

View File

@ -157,7 +157,7 @@ class OtherFileTests(unittest.TestCase):
s = str(msg)
if s.find(TESTFN) != -1 or s.find(bad_mode) == -1:
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.
else:
f.close()

View File

@ -172,7 +172,7 @@ class OtherFileTests(unittest.TestCase):
s = str(msg)
if s.find(TESTFN) != -1 or s.find(bad_mode) == -1:
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.
else:
f.close()