From: Georg Brandl Date: Sun, 6 Jan 2008 21:38:54 +0000 (+0000) Subject: The final occurrences of exception slicing. X-Git-Tag: v3.0a3~229 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=50da60cc5bc82799b3636c18b18f24dd208823ec;p=thirdparty%2FPython%2Fcpython.git The final occurrences of exception slicing. --- diff --git a/Lib/pstats.py b/Lib/pstats.py index 4396433b7dcc..5a2f2d07b367 100644 --- a/Lib/pstats.py +++ b/Lib/pstats.py @@ -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: diff --git a/Lib/test/test_file.py b/Lib/test/test_file.py index ab29932e8f8e..5da2da9c0e26 100644 --- a/Lib/test/test_file.py +++ b/Lib/test/test_file.py @@ -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() diff --git a/Lib/test/test_fileio.py b/Lib/test/test_fileio.py index 4028927ff099..7f7332ea8275 100644 --- a/Lib/test/test_fileio.py +++ b/Lib/test/test_fileio.py @@ -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()