gh-130123: Make __new__ wrapper be deferred (#130124)

Make __new__ wrapper be deferred
This commit is contained in:
Dino Viehland 2025-02-14 12:50:54 -08:00 committed by GitHub
parent e65e9f9062
commit 5a586c3e81
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -9564,6 +9564,7 @@ add_tp_new_wrapper(PyTypeObject *type)
if (func == NULL) {
return -1;
}
_PyObject_SetDeferredRefcount(func);
r = PyDict_SetItem(dict, &_Py_ID(__new__), func);
Py_DECREF(func);
return r;