Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 006c5a2

Browse files
committed
check for NULL to fix segfault
1 parent 23d7f12 commit 006c5a2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Objects/typeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1807,7 +1807,7 @@ subtype_setdict(PyObject *obj, PyObject *value, void *context)
18071807
"This object has no __dict__");
18081808
return -1;
18091809
}
1810-
if (!PyDict_Check(value)) {
1810+
if (value != NULL && !PyDict_Check(value)) {
18111811
PyErr_Format(PyExc_TypeError,
18121812
"__dict__ must be set to a dictionary, "
18131813
"not a '%.200s'", Py_TYPE(value)->tp_name);

0 commit comments

Comments
 (0)