Skip to content

Commit ef32bf2

Browse files
authored
Merge pull request #320 from zopefoundation/fix-weaklistoffset
Fix __weaklistoffset__ in SB_members with USE_EXPLICIT_WEAKREFLIST
2 parents c3a4945 + 81f64e3 commit ef32bf2

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGES.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
7.0.3 (unreleased)
66
==================
77

8+
- Fix `Assertion 'memb->type == T_PYSSIZET' failed.` for Python < 3.12.
9+
(`#319 <https://github.com/zopefoundation/zope.interface/issues/319>`_)
10+
811

912
7.0.2 (2024-08-26)
1013
==================

src/zope/interface/_zope_interface_coptimizations.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ static PyMemberDef SB_members[] = {
400400
{ "__iro__", T_OBJECT_EX, offsetof(SB, __iro__), 0, "" },
401401
{ "__sro__", T_OBJECT_EX, offsetof(SB, __sro__), 0, "" },
402402
#if USE_EXPLICIT_WEAKREFLIST
403-
{ "__weaklistoffset__", T_OBJECT_EX, offsetof(SB, weakreflist), 0, "" },
403+
{ "__weaklistoffset__", T_PYSSIZET, offsetof(SB, weakreflist), READONLY, "" },
404404
#endif
405405
{ NULL },
406406
};
@@ -649,7 +649,7 @@ static PyType_Slot CPB_type_slots[] = {
649649
{Py_tp_clear, CPB_clear},
650650
{Py_tp_dealloc, CPB_dealloc},
651651
{Py_tp_members, CPB_members},
652-
/* tp_base cannot be set as a stot -- pass to PyType_FromModuleAndSpec */
652+
/* tp_base cannot be set as a slot -- pass to PyType_FromModuleAndSpec */
653653
{0, NULL}
654654
};
655655

0 commit comments

Comments
 (0)