summaryrefslogtreecommitdiffstats
path: root/Objects/abstract.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/abstract.c')
-rw-r--r--Objects/abstract.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index a2737dd..7c24724 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -1293,6 +1293,8 @@ PyNumber_Long(PyObject *o)
PyObject *truncated = PyEval_CallObject(trunc_func, NULL);
PyObject *int_instance;
Py_DECREF(trunc_func);
+ if (truncated == NULL)
+ return NULL;
/* __trunc__ is specified to return an Integral type,
but int() needs to return a int. */
int_instance = convert_integral_to_int(truncated,