Commit 006c5a22 authored by Benjamin Peterson's avatar Benjamin Peterson

check for NULL to fix segfault

parent 23d7f12f
......@@ -1807,7 +1807,7 @@ subtype_setdict(PyObject *obj, PyObject *value, void *context)
"This object has no __dict__");
return -1;
}
if (!PyDict_Check(value)) {
if (value != NULL && !PyDict_Check(value)) {
PyErr_Format(PyExc_TypeError,
"__dict__ must be set to a dictionary, "
"not a '%.200s'", Py_TYPE(value)->tp_name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment