Skip to content

Commit 4619540

Browse files
Fix tests on WASI.
1 parent 9e1a88f commit 4619540

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Lib/test/test_posixpath.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,10 +555,11 @@ def test_realpath_invalid_paths(self):
555555
self.assertRaises(UnicodeDecodeError, realpath, path, strict=True)
556556
else:
557557
self.assertEqual(realpath(path, strict=False), path)
558-
self.assertEqual(realpath(path, strict=ALL_BUT_LAST), path)
559558
if support.is_wasi:
559+
self.assertRaises(OSError, realpath, path, strict=ALL_BUT_LAST)
560560
self.assertRaises(OSError, realpath, path, strict=True)
561561
else:
562+
self.assertEqual(realpath(path, strict=ALL_BUT_LAST), path)
562563
self.assertRaises(FileNotFoundError, realpath, path, strict=True)
563564
path = b'/nonexistent/\xff'
564565
if sys.platform == 'win32':

0 commit comments

Comments
 (0)