summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Objects/typeobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 41488a4..88c4a15 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -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;
}