]> granicus.if.org Git - python/commitdiff
The final occurrences of exception slicing.
authorGeorg Brandl <georg@python.org>
Sun, 6 Jan 2008 21:38:54 +0000 (21:38 +0000)
committerGeorg Brandl <georg@python.org>
Sun, 6 Jan 2008 21:38:54 +0000 (21:38 +0000)
Lib/pstats.py
Lib/test/test_file.py
Lib/test/test_fileio.py

index 4396433b7dcc48c61e81a79a6a5ee66d4e8f6346..5a2f2d07b367900b915a47e9b3e24e40d9349136 100644 (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:
index ab29932e8f8ee0e9bea0b4ec6c556b1d846e6b59..5da2da9c0e26d1a138e24ed7528308ad89e3eee8 100644 (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()
index 4028927ff0994d968673873cbb149b7acf02ef39..7f7332ea8275b998048fea0125f4b2eec3420ed2 100644 (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()