diff options
author | Nice Zombies <nineteendo19d0@gmail.com> | 2024-03-28 22:20:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-28 21:20:08 +0000 |
commit | 14f1ca7d5363386163839b31ce987423daecc3de (patch) | |
tree | 6c074f58ddb90dc77298051241c0f505e4823de4 /Lib/test/test_ntpath.py | |
parent | 18cf239e39e25e6cef50ecbb7f197a82f8920ff5 (diff) | |
download | cpython-14f1ca7d5363386163839b31ce987423daecc3de.tar.gz cpython-14f1ca7d5363386163839b31ce987423daecc3de.zip |
gh-117335: Handle non-iterables for `ntpath.commonpath` (GH-117336)
Diffstat (limited to 'Lib/test/test_ntpath.py')
-rw-r--r-- | Lib/test/test_ntpath.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_ntpath.py b/Lib/test/test_ntpath.py index 9cb03e3cd5d..c816f99e7e9 100644 --- a/Lib/test/test_ntpath.py +++ b/Lib/test/test_ntpath.py @@ -871,11 +871,14 @@ class TestNtpath(NtpathTestCase): self.assertRaises(exc, ntpath.commonpath, [os.fsencode(p) for p in paths]) + self.assertRaises(TypeError, ntpath.commonpath, None) self.assertRaises(ValueError, ntpath.commonpath, []) + self.assertRaises(ValueError, ntpath.commonpath, iter([])) check_error(ValueError, ['C:\\Program Files', 'Program Files']) check_error(ValueError, ['C:\\Program Files', 'C:Program Files']) check_error(ValueError, ['\\Program Files', 'Program Files']) check_error(ValueError, ['Program Files', 'C:\\Program Files']) + check(['C:\\Program Files'], 'C:\\Program Files') check(['C:\\Program Files', 'C:\\Program Files'], 'C:\\Program Files') check(['C:\\Program Files\\', 'C:\\Program Files'], |