diff options
Diffstat (limited to 'Python/_warnings.c')
-rw-r--r-- | Python/_warnings.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/_warnings.c b/Python/_warnings.c index c49f3f3..b1b2b71 100644 --- a/Python/_warnings.c +++ b/Python/_warnings.c @@ -116,7 +116,7 @@ get_filter(PyObject *category, PyObject *text, Py_ssize_t lineno, _filters = warnings_filters; } - if (!PyList_Check(_filters)) { + if (_filters == NULL || !PyList_Check(_filters)) { PyErr_SetString(PyExc_ValueError, MODULE_NAME ".filters must be a list"); return NULL; |