diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-02-09 20:25:49 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-02-09 20:25:49 (GMT) |
commit | 7451a72e2ba8939215324387e36285725632e637 (patch) | |
tree | f73f91484cb022179212c1af2a5e6752fdd70bd9 /Lib/test/test_tempfile.py | |
parent | f4b54adc706c6b0eb5d0d4bda5cdcf43ef28171b (diff) | |
download | cpython-7451a72e2ba8939215324387e36285725632e637.zip cpython-7451a72e2ba8939215324387e36285725632e637.tar.gz cpython-7451a72e2ba8939215324387e36285725632e637.tar.bz2 |
Issue #17169: Restore errno in tempfile exceptions.
Diffstat (limited to 'Lib/test/test_tempfile.py')
-rw-r--r-- | Lib/test/test_tempfile.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py index 40e5e6f..7f4d5b9 100644 --- a/Lib/test/test_tempfile.py +++ b/Lib/test/test_tempfile.py @@ -1,5 +1,6 @@ # tempfile.py unit tests. import tempfile +import errno import os import signal import sys @@ -963,8 +964,9 @@ class TestTemporaryDirectory(BaseTestCase): # (noted as part of Issue #10188) with tempfile.TemporaryDirectory() as nonexistent: pass - with self.assertRaises(os.error): + with self.assertRaises(FileNotFoundError) as cm: tempfile.TemporaryDirectory(dir=nonexistent) + self.assertEqual(cm.exception.errno, errno.ENOENT) def test_explicit_cleanup(self): # A TemporaryDirectory is deleted when cleaned up |