diff options
author | Brett Cannon <bcannon@gmail.com> | 2007-03-21 22:26:20 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2007-03-21 22:26:20 (GMT) |
commit | ca477b228084b9f8f9c8d5818e49261d708dfdcf (patch) | |
tree | 77859a50d3fddc5e3a4ea7826317511706beb42a /Lib/test/test_file.py | |
parent | 3a38362592ee423852d1b32a32d65520bc003ffc (diff) | |
download | cpython-ca477b228084b9f8f9c8d5818e49261d708dfdcf.zip cpython-ca477b228084b9f8f9c8d5818e49261d708dfdcf.tar.gz cpython-ca477b228084b9f8f9c8d5818e49261d708dfdcf.tar.bz2 |
When removing indexing/slicing on exceptions some places were changed
inappropriately from ``e[0]`` to ``e.message`` instead of ``e.args[0]``. The
reason it needs to be the last option is the dichotomy of 'message' and 'args':
'message' can be the empty string but args[0] can have a value if more than one
argument was passed.
Diffstat (limited to 'Lib/test/test_file.py')
-rw-r--r-- | Lib/test/test_file.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/test_file.py b/Lib/test/test_file.py index a57ab43..c4bd610 100644 --- a/Lib/test/test_file.py +++ b/Lib/test/test_file.py @@ -156,7 +156,7 @@ class OtherFileTests(unittest.TestCase): try: f = open(TESTFN, bad_mode) except ValueError as msg: - if msg.message != 0: + if msg.args[0] != 0: s = str(msg) if s.find(TESTFN) != -1 or s.find(bad_mode) == -1: self.fail("bad error message for invalid mode: %s" % s) |