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 a9952ac commit 6938997Copy full SHA for 6938997
Objects/typeobject.c
@@ -1290,7 +1290,7 @@ _PyType_AllocNoTrack(PyTypeObject *type, Py_ssize_t nitems)
1290
{
1291
PyObject *obj;
1292
size_t extra = 0;
1293
- if (type->tp_flags & Py_TPFLAGS_TYPE_SUBCLASS) {
+ if (type->tp_flags & Py_TPFLAGS_TYPE_SUBCLASS || type->tp_vectorcall != NULL) {
1294
/* note that we need to add one, for the sentinel */
1295
extra = 1;
1296
}
@@ -1312,7 +1312,7 @@ _PyType_AllocNoTrack(PyTypeObject *type, Py_ssize_t nitems)
1312
_PyObject_Init(obj, type);
1313
1314
else {
1315
- _PyObject_InitVar((PyVarObject *)obj, type, nitems);
+ _PyObject_InitVar((PyVarObject *)obj, type, nitems + extra);
1316
1317
return obj;
1318
0 commit comments