]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-130123: Make __new__ wrapper be deferred (#130124)
authorDino Viehland <dinoviehland@meta.com>
Fri, 14 Feb 2025 20:50:54 +0000 (12:50 -0800)
committerGitHub <noreply@github.com>
Fri, 14 Feb 2025 20:50:54 +0000 (12:50 -0800)
Make __new__ wrapper be deferred

Objects/typeobject.c

index 818a00708b5d3d2189f1a298c281dd56c4c1e13f..1fa1220aeec648f0faf1d7aa576493b54c68e9ba 100644 (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;