summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
Diffstat (limited to 'Objects')
-rw-r--r--Objects/typeobject.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index ed5b829..e624ec4 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -3145,8 +3145,12 @@ slot_sq_item(PyObject *self, int i)
if (func != NULL) {
if ((f = func->ob_type->tp_descr_get) == NULL)
Py_INCREF(func);
- else
+ else {
func = f(func, self, (PyObject *)(self->ob_type));
+ if (func == NULL) {
+ return NULL;
+ }
+ }
ival = PyInt_FromLong(i);
if (ival != NULL) {
args = PyTuple_New(1);