diff options
Diffstat (limited to 'Objects/abstract.c')
-rw-r--r-- | Objects/abstract.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c index 4326cfa..bfd53c9 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -1314,6 +1314,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, |