Use Py_NewRef

This commit is contained in:
sweeneyde 2021-01-02 05:39:52 -05:00
parent 9ec599f929
commit 2f1f1805d1
1 changed files with 1 additions and 3 deletions

View File

@ -2897,9 +2897,7 @@ type_vectorcall(PyObject *metatype, PyObject *const *args,
if (!_PyArg_NoKwnames("type", kwnames)) {
return NULL;
}
PyObject *tp = (PyObject *)Py_TYPE(args[0]);
Py_INCREF(tp);
return tp;
return Py_NewRef(Py_TYPE(args[0]));
}
/* In other (much less common) cases, fall back to
more flexible calling conventions. */