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

@ -354,6 +354,12 @@ class IntTestCases(unittest.TestCase):
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):