Skip to content

Commit 4d3f620

Browse files
committed
Enable the test on Free Threading
The Py_tp_basicsize slot is not required to define a type.
1 parent d6583b7 commit 4d3f620

1 file changed

Lines changed: 0 additions & 6 deletions

File tree

‎Lib/test/test_cext/extension.c‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,6 @@ test_macros(PyObject *Py_UNUSED(module), PyObject *Py_UNUSED(args))
140140
}
141141

142142

143-
// sizeof(PyObject) in PySlot below is incompatible with opaque PyObject
144-
#ifndef Py_TARGET_ABI3T
145143
Py_NO_INLINE static void
146144
pyclear_strict_aliasing(PyTypeObject **a, PyTypeObject **b)
147145
{
@@ -175,7 +173,6 @@ test_setref_strict_aliasing(PyObject *Py_UNUSED(module), PyObject *Py_UNUSED(arg
175173
{
176174
PySlot slots[] = {
177175
PySlot_PTR_STATIC(Py_tp_name, STR(MODULE_NAME) ".setref_type"),
178-
PySlot_PTR_STATIC(Py_tp_basicsize, sizeof(PyObject)),
179176
PySlot_PTR_STATIC(Py_tp_flags, Py_TPFLAGS_DEFAULT),
180177
PySlot_END
181178
};
@@ -222,7 +219,6 @@ test_setref_strict_aliasing(PyObject *Py_UNUSED(module), PyObject *Py_UNUSED(arg
222219

223220
Py_RETURN_NONE;
224221
}
225-
#endif // !Py_TARGET_ABI3T
226222

227223

228224
static PyObject *
@@ -451,9 +447,7 @@ test_virtual_object(PyObject *Py_UNUSED(module), PyObject *Py_UNUSED(args))
451447
static PyMethodDef module_methods[] = {
452448
{"add", test_add, METH_VARARGS, test_add_doc},
453449
{"test_macros", test_macros, METH_NOARGS, _Py_NULL},
454-
#ifndef Py_TARGET_ABI3T
455450
{"test_setref_strict_aliasing", test_setref_strict_aliasing, METH_NOARGS, _Py_NULL},
456-
#endif
457451
{"test_datetime", test_datetime, METH_NOARGS, _Py_NULL},
458452
{"test_unicode", test_unicode, METH_NOARGS, _Py_NULL},
459453
#ifdef __cplusplus

0 commit comments

Comments
 (0)