We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a026273 commit f23671cCopy full SHA for f23671c
Modules/_struct.c
@@ -1451,7 +1451,10 @@ static PyObject *
1451
Struct_impl(PyTypeObject *type, PyObject *format)
1452
/*[clinic end generated code: output=49468b044e334308 input=8b91868eb1df0e28]*/
1453
{
1454
- PyStructObject *self = (PyStructObject *)type->tp_alloc(type, 0);
+ allocfunc alloc = PyType_GetSlot(type, Py_tp_alloc);
1455
+ assert(alloc != NULL);
1456
+ PyStructObject *self = (PyStructObject *)alloc(type, 0);
1457
+
1458
if (self == NULL) {
1459
return NULL;
1460
}
0 commit comments