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 fdfadf0 commit 26c6425Copy full SHA for 26c6425
Python/pylifecycle.c
@@ -1546,9 +1546,12 @@ static PyObject*
1546
finalize_remove_modules(PyObject *modules, int verbose)
1547
{
1548
PyObject *weaklist = PyList_New(0);
1549
- PyObject *weak_ext = PyList_New(0); // for extending the weaklist
1550
- if (weak_ext == NULL) {
1551
- Py_CLEAR(weaklist);
+ PyObject *weak_ext = NULL; // for extending the weaklist
+ if (weaklist != NULL) {
+ weak_ext = PyList_New(0);
1552
+ if (weak_ext == NULL) {
1553
+ Py_CLEAR(weaklist);
1554
+ }
1555
}
1556
if (weaklist == NULL) {
1557
PyErr_FormatUnraisable("Exception ignored while removing modules");
0 commit comments