summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
Diffstat (limited to 'Objects')
-rw-r--r--Objects/object.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Objects/object.c b/Objects/object.c
index f84e64f..1a1ed52 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -844,7 +844,11 @@ Py_ReprLeave(obj)
int i;
dict = PyThreadState_GetDict();
+ if (dict == NULL)
+ return;
list = PyDict_GetItemString(dict, KEY);
+ if (list == NULL || !PyList_Check(list))
+ return;
i = PyList_GET_SIZE(list);
/* Count backwards because we always expect obj to be list[-1] */
while (--i >= 0) {