diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-02-09 20:27:23 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-02-09 20:27:23 (GMT) |
commit | 26cab565423a830701667555980232baeca07580 (patch) | |
tree | 2bbccd21ea340ea78158efefe4eae980d0f963a0 /Lib/test | |
parent | 31c3cd2fb8aa7d587f1c1317052f48f45de97094 (diff) | |
parent | 7451a72e2ba8939215324387e36285725632e637 (diff) | |
download | cpython-26cab565423a830701667555980232baeca07580.zip cpython-26cab565423a830701667555980232baeca07580.tar.gz cpython-26cab565423a830701667555980232baeca07580.tar.bz2 |
Issue #17169: Restore errno in tempfile exceptions.
Diffstat (limited to 'Lib/test')
-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 b0c3b4b..ecad944 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(OSError): + 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 |