From ec862b907aff99a4f256b946764f349f4d1d0c5c Mon Sep 17 00:00:00 2001 From: Armin Rigo Date: Sat, 24 Sep 2005 22:58:41 +0000 Subject: [PATCH] (pedronis, arigo) segfault when a class contain a non-list value in the (undocumented) special attribute __slotnames__. --- Objects/typeobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 41488a4a18..88c4a15d67 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; } -- 2.49.0