diff options
author | Pablo Galindo Salgado <Pablogsal@gmail.com> | 2021-07-16 23:34:46 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-16 23:34:46 (GMT) |
commit | f783428a2313a729ca8b539c5a86ff114b9ff375 (patch) | |
tree | 0a7544bd351ea47745d7406bc1adba01e63f9681 /Lib | |
parent | 6714dec5e104bdee4a0ed4d9966de27d1bfa1e3d (diff) | |
download | cpython-f783428a2313a729ca8b539c5a86ff114b9ff375.zip cpython-f783428a2313a729ca8b539c5a86ff114b9ff375.tar.gz cpython-f783428a2313a729ca8b539c5a86ff114b9ff375.tar.bz2 |
bpo-44655: Include the name of the type in unset __slots__ attribute errors (GH-27199)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_descr.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index 0ff4d02..71b6954 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -1303,6 +1303,12 @@ order (MRO) for bases """ with self.assertRaises(AttributeError): del X().a + # Inherit from object on purpose to check some backwards compatibility paths + class X(object): + __slots__ = "a" + with self.assertRaisesRegex(AttributeError, "'X' object has no attribute 'a'"): + X().a + def test_slots_special(self): # Testing __dict__ and __weakref__ in __slots__... class D(object): |