diff options
| author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-05-20 21:00:34 +0000 |
|---|---|---|
| committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-05-20 21:00:34 +0000 |
| commit | a580bf9536ba88c7a260488a4c5d433818881f4f (patch) | |
| tree | 2e87a86de557fffe856ec13c52e10bdfd89dde86 /Python/_warnings.c | |
| parent | c76d02d834ad139684b06974aa658db1f2a918e7 (diff) | |
| download | cpython-a580bf9536ba88c7a260488a4c5d433818881f4f.tar.gz | |
Recorded merge of revisions 81364 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r81364 | victor.stinner | 2010-05-19 22:40:50 +0200 (mer., 19 mai 2010) | 3 lines
Issue #8766: Initialize _warnings module before importing the first module.
Fix a crash if an empty directory called "encodings" exists in sys.path.
........
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 f0e1e512f5..94538443c0 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; |
