diff options
author | Richard Oudkerk <shibturn@gmail.com> | 2012-08-28 18:33:26 (GMT) |
---|---|---|
committer | Richard Oudkerk <shibturn@gmail.com> | 2012-08-28 18:33:26 (GMT) |
commit | 30147710e8d6b2b5aebcf6f774fe289a4918958c (patch) | |
tree | aa70457708b93bd0dbe12b1e6d8a17582d12ed71 /Lib/test/test_exceptions.py | |
parent | ca2b64682e2f3c5e3fb2ed150600a73105119e82 (diff) | |
download | cpython-30147710e8d6b2b5aebcf6f774fe289a4918958c.zip cpython-30147710e8d6b2b5aebcf6f774fe289a4918958c.tar.gz cpython-30147710e8d6b2b5aebcf6f774fe289a4918958c.tar.bz2 |
Issue #15784: Modify OSError.__str__() to better distinguish between
errno error numbers and Windows error numbers.
Diffstat (limited to 'Lib/test/test_exceptions.py')
-rw-r--r-- | Lib/test/test_exceptions.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py index 55e9db3..413f4dd 100644 --- a/Lib/test/test_exceptions.py +++ b/Lib/test/test_exceptions.py @@ -216,14 +216,14 @@ class ExceptionTests(unittest.TestCase): self.assertEqual(w.winerror, 3) self.assertEqual(w.strerror, 'foo') self.assertEqual(w.filename, 'bar') - self.assertEqual(str(w), "[Error 3] foo: 'bar'") + self.assertEqual(str(w), "[WinError 3] foo: 'bar'") # Unknown win error becomes EINVAL (22) w = OSError(0, 'foo', None, 1001) self.assertEqual(w.errno, 22) self.assertEqual(w.winerror, 1001) self.assertEqual(w.strerror, 'foo') self.assertEqual(w.filename, None) - self.assertEqual(str(w), "[Error 1001] foo") + self.assertEqual(str(w), "[WinError 1001] foo") # Non-numeric "errno" w = OSError('bar', 'foo') self.assertEqual(w.errno, 'bar') |