[Python-3000-checkins] r59794 - in python/branches/py3k/Lib: pstats.py test/test_file.py test/test_fileio.py

georg.brandl python-3000-checkins at python.org
Sun Jan 6 22:38:55 CET 2008


Author: georg.brandl
Date: Sun Jan  6 22:38:54 2008
New Revision: 59794

Modified:
   python/branches/py3k/Lib/pstats.py
   python/branches/py3k/Lib/test/test_file.py
   python/branches/py3k/Lib/test/test_fileio.py
Log:
The final occurrences of exception slicing.


Modified: python/branches/py3k/Lib/pstats.py
==============================================================================
--- python/branches/py3k/Lib/pstats.py	(original)
+++ python/branches/py3k/Lib/pstats.py	Sun Jan  6 22:38:54 2008
@@ -617,8 +617,8 @@
             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:

Modified: python/branches/py3k/Lib/test/test_file.py
==============================================================================
--- python/branches/py3k/Lib/test/test_file.py	(original)
+++ python/branches/py3k/Lib/test/test_file.py	Sun Jan  6 22:38:54 2008
@@ -157,7 +157,7 @@
                 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()

Modified: python/branches/py3k/Lib/test/test_fileio.py
==============================================================================
--- python/branches/py3k/Lib/test/test_fileio.py	(original)
+++ python/branches/py3k/Lib/test/test_fileio.py	Sun Jan  6 22:38:54 2008
@@ -172,7 +172,7 @@
                 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()


More information about the Python-3000-checkins mailing list