mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
gh-117657: Fix __slots__
thread safety in free-threaded build (#119368)
Fix a race in `PyMember_GetOne` and `PyMember_SetOne` for `Py_T_OBJECT_EX`. These functions implement `__slots__` accesses for Python objects.
This commit is contained in:
parent
460cc9e14e
commit
362cd2680b
4 changed files with 77 additions and 12 deletions
|
@ -1314,7 +1314,7 @@ class ClassPropertiesAndMethods(unittest.TestCase):
|
|||
# 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'"):
|
||||
with self.assertRaisesRegex(AttributeError, "'test.test_descr.ClassPropertiesAndMethods.test_slots.<locals>.X' object has no attribute 'a'"):
|
||||
X().a
|
||||
|
||||
# Test string subclass in `__slots__`, see gh-98783
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue