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 47534f3 commit fa8434bCopy full SHA for fa8434b
Modules/gcmodule.c
@@ -1390,6 +1390,12 @@ invoke_gc_callback(PyThreadState *tstate, const char *phase,
1390
}
1391
1392
PyObject *phase_obj = PyUnicode_FromString(phase);
1393
+ if (phase_obj == NULL) {
1394
+ Py_XDECREF(info);
1395
+ PyErr_WriteUnraisable(NULL);
1396
+ return;
1397
+ }
1398
+
1399
PyObject *stack[] = {phase_obj, info};
1400
for (Py_ssize_t i=0; i<PyList_GET_SIZE(gcstate->callbacks); i++) {
1401
PyObject *r, *cb = PyList_GET_ITEM(gcstate->callbacks, i);
0 commit comments