diff options
author | Bar Harel <bzvi7919@gmail.com> | 2019-12-23 18:31:15 (GMT) |
---|---|---|
committer | Ivan Levkivskyi <levkivskyi@gmail.com> | 2019-12-23 18:31:15 (GMT) |
commit | 59d06b987db34cde8783e265709366d244c9e35b (patch) | |
tree | 203e76c6da36fa015b0dfd79da7b538e0731baba /Lib/test/test_os.py | |
parent | 0ffc90031cadf5637cfc13a40899e71c259c49b1 (diff) | |
download | cpython-59d06b987db34cde8783e265709366d244c9e35b.zip cpython-59d06b987db34cde8783e265709366d244c9e35b.tar.gz cpython-59d06b987db34cde8783e265709366d244c9e35b.tar.bz2 |
[3.7] bpo-38878: Fix os.PathLike __subclasshook__ (GH-17336) (GH-17685)
https://bugs.python.org/issue38878
Diffstat (limited to 'Lib/test/test_os.py')
-rw-r--r-- | Lib/test/test_os.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index df4bad7..411e5aa 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -3745,6 +3745,14 @@ class TestPEP519(unittest.TestCase): self.assertRaises(ZeroDivisionError, self.fspath, FakePath(ZeroDivisionError())) + def test_pathlike_subclasshook(self): + # bpo-38878: subclasshook causes subclass checks + # true on abstract implementation. + class A(os.PathLike): + pass + self.assertFalse(issubclass(FakePath, A)) + self.assertTrue(issubclass(FakePath, os.PathLike)) + class TimesTests(unittest.TestCase): def test_times(self): |