summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pep277.py
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2011-11-07 22:24:08 (GMT)
committerFlorent Xicluna <florent.xicluna@gmail.com>2011-11-07 22:24:08 (GMT)
commitbe908405a5ceb28dbbe9f60557bad0e4ed083a49 (patch)
treedb65a9566abec3767caac9864d8e3314486c7721 /Lib/test/test_pep277.py
parent7eb65847da045ec77de8073efa06b9f1e9d7e243 (diff)
downloadcpython-be908405a5ceb28dbbe9f60557bad0e4ed083a49.zip
cpython-be908405a5ceb28dbbe9f60557bad0e4ed083a49.tar.gz
cpython-be908405a5ceb28dbbe9f60557bad0e4ed083a49.tar.bz2
Some win32 platforms raise NotADirectoryError, others FileNotFoundError. Issue #13366.
Diffstat (limited to 'Lib/test/test_pep277.py')
-rw-r--r--Lib/test/test_pep277.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_pep277.py b/Lib/test/test_pep277.py
index df4b592..a1a4791 100644
--- a/Lib/test/test_pep277.py
+++ b/Lib/test/test_pep277.py
@@ -99,7 +99,7 @@ class UnicodeFileTests(unittest.TestCase):
# listdir may append a wildcard to the filename
if fn is os.listdir and sys.platform == 'win32':
exc_filename, _, wildcard = exc_filename.rpartition(os.sep)
- self.assertEqual(wildcard, r'*.*')
+ self.assertEqual(wildcard, '*.*')
if check_filename:
self.assertEqual(exc_filename, filename, "Function '%s(%a) failed "
"with bad filename in the exception: %a" %
@@ -117,7 +117,8 @@ class UnicodeFileTests(unittest.TestCase):
self._apply_failure(os.listdir, name)
if sys.platform == 'win32':
- _listdir_failure = FileNotFoundError
+ # Windows is lunatic. Issue #13366.
+ _listdir_failure = NotADirectoryError, FileNotFoundError
else:
_listdir_failure = NotADirectoryError
@@ -146,7 +147,6 @@ class UnicodeFileTests(unittest.TestCase):
self._apply_failure(os.chdir, name)
self._apply_failure(os.rmdir, name)
self._apply_failure(os.remove, name)
- # listdir may append a wildcard to the filename, so dont check
self._apply_failure(os.listdir, name)
# Skip the test on darwin, because darwin uses a normalization different