diff -r e948154af406 Lib/test/test_int.py --- a/Lib/test/test_int.py Sat Apr 13 18:00:04 2013 +0300 +++ b/Lib/test/test_int.py Sat Apr 13 17:15:58 2013 +0100 @@ -313,6 +313,12 @@ return 42 self.assertEqual(int(JustTrunc()), 42) + class ExceptionalTrunc(base): + def __trunc__(self): + 1 / 0 + with self.assertRaises(ZeroDivisionError): + int(ExceptionalTrunc()) + for trunc_result_base in (object, Classic): class Integral(trunc_result_base): def __int__(self): diff -r e948154af406 Objects/abstract.c --- a/Objects/abstract.c Sat Apr 13 18:00:04 2013 +0300 +++ b/Objects/abstract.c Sat Apr 13 17:15:58 2013 +0100 @@ -1293,6 +1293,8 @@ 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,