testformat('%g', 1.1, '1.1')
testformat('%#g', 1.1, '1.10000')
+ # Regression test for http://bugs.python.org/issue15516.
+ class IntFails(object):
+ def __int__(self):
+ raise TestFailed
+ def __long__(self):
+ return 0
+
+ fst = IntFails()
+ testformat("%x", fst, '0')
+
# Test exception for unknown format characters
if verbose:
print 'Testing exceptions'
Core and Builtins
-----------------
+- Issue #15516: Fix a bug in PyString_FromFormat where it failed to properly
+ ignore errors from a __int__() method.
+
- Issue #16839: Fix a segfault when calling unicode() on a classic class early
in interpreter initialization.