mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
bpo-44655: Include the name of the type in unset __slots__ attribute errors (GH-27199)
This commit is contained in:
parent
6714dec5e1
commit
f783428a23
3 changed files with 17 additions and 4 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue