Skip to content

Commit afb07fc

Browse files
bpo-35414: Add a missing Py_INCREF(Py_None) in PyState_RemoveModule(). (GH-10914)
(cherry picked from commit 2a89343) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
1 parent 93d038c commit afb07fc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Python/pystate.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ PyState_RemoveModule(struct PyModuleDef* def)
377377
Py_FatalError("PyState_RemoveModule: Module index out of bounds.");
378378
return -1;
379379
}
380+
Py_INCREF(Py_None);
380381
return PyList_SetItem(state->modules_by_index, index, Py_None);
381382
}
382383

0 commit comments

Comments
 (0)