mirror of https://github.com/python/cpython
(pedronis, arigo)
segfault when a class contain a non-list value in the (undocumented) special attribute __slotnames__.
This commit is contained in:
parent
6b27cda643
commit
ec862b907a
|
@ -2522,7 +2522,7 @@ slotnames(PyObject *cls)
|
|||
|
||||
clsdict = ((PyTypeObject *)cls)->tp_dict;
|
||||
slotnames = PyDict_GetItemString(clsdict, "__slotnames__");
|
||||
if (slotnames != NULL) {
|
||||
if (slotnames != NULL && PyList_Check(slotnames)) {
|
||||
Py_INCREF(slotnames);
|
||||
return slotnames;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue