summaryrefslogtreecommitdiffstats
path: root/Objects/object.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/object.c')
-rw-r--r--Objects/object.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Objects/object.c b/Objects/object.c
index 470da60..d8e403b 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -1702,6 +1702,11 @@ PyObject_Dir(PyObject *arg)
}
assert(result);
+ if (!PyList_Check(result)) {
+ PyErr_SetString(PyExc_TypeError,
+ "Expected keys() to be a list.");
+ goto error;
+ }
if (PyList_Sort(result) != 0)
goto error;
else