Issue #17715: Merge fix from 3.3.

This commit is contained in:
Mark Dickinson 2013-04-13 17:46:04 +01:00
commit 93196eb44f
3 changed files with 11 additions and 0 deletions

View file

@ -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,