summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_exceptions.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_exceptions.py')
-rw-r--r--Lib/test/test_exceptions.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py
index d3c0062..0a7ddd4 100644
--- a/Lib/test/test_exceptions.py
+++ b/Lib/test/test_exceptions.py
@@ -5,6 +5,7 @@ import sys
import unittest
import pickle
import weakref
+import errno
from test.support import (TESTFN, unlink, run_unittest, captured_output,
gc_collect, cpython_only)
@@ -849,6 +850,13 @@ class ExceptionTests(unittest.TestCase):
self.fail("RuntimeError not raised")
self.assertEqual(wr(), None)
+ def test_errno_ENOTDIR(self):
+ # Issue #12802: "not a directory" errors are ENOTDIR even on Windows
+ with self.assertRaises(OSError) as cm:
+ os.listdir(__file__)
+ self.assertEqual(cm.exception.errno, errno.ENOTDIR, cm.exception)
+
+
def test_main():
run_unittest(ExceptionTests)