summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_tempfile.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_tempfile.py')
-rw-r--r--Lib/test/test_tempfile.py4
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