Skip to content

Commit 2d594f8

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 c93e3b0 commit 2d594f8

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Python/pystate.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,7 @@ PyState_RemoveModule(struct PyModuleDef* def)
532532
Py_FatalError("PyState_RemoveModule: Module index out of bounds.");
533533
return -1;
534534
}
535+
Py_INCREF(Py_None);
535536
return PyList_SetItem(state->modules_by_index, index, Py_None);
536537
}
537538

0 commit comments

Comments
 (0)