GH-104898: Add __slots__ to os.PathLike (GH-104899)

This commit is contained in:
Barney Gale 2023-05-25 21:24:20 +01:00 committed by GitHub
parent fea8632ec6
commit bd1b6228d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 5 deletions

View file

@ -4640,6 +4640,12 @@ class TestPEP519(unittest.TestCase):
def test_pathlike_class_getitem(self):
self.assertIsInstance(os.PathLike[bytes], types.GenericAlias)
def test_pathlike_subclass_slots(self):
class A(os.PathLike):
__slots__ = ()
def __fspath__(self):
return ''
self.assertFalse(hasattr(A(), '__dict__'))
class TimesTests(unittest.TestCase):
def test_times(self):