We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 271e017 commit 331d676Copy full SHA for 331d676
Modules/gcmodule.c
@@ -1997,14 +1997,17 @@ gcmodule_exec(PyObject *module)
1997
{
1998
GCState *gcstate = get_gc_state();
1999
2000
- gcstate->garbage = PyList_New(0);
+ /* Initialized by _PyGC_Init() early in interpreter lifecycle */
2001
if (gcstate->garbage == NULL) {
2002
+ PyErr_SetString(PyExc_SystemError,
2003
+ "GC garbage bin is not initialized");
2004
return -1;
2005
}
2006
if (PyModule_AddObjectRef(module, "garbage", gcstate->garbage) < 0) {
2007
2008
2009
2010
+ assert(gcstate->callbacks == NULL);
2011
gcstate->callbacks = PyList_New(0);
2012
if (gcstate->callbacks == NULL) {
2013
0 commit comments