ignore errors from a __int__() method.
Patch based on the patch for issue #15516.
fst = IntFails()
testformat("%x", fst, '0')
+ testformat(u"%x", fst, '0')
# Test exception for unknown format characters
if verbose:
Core and Builtins
-----------------
+- Issue #13410: Fixed a bug in PyUnicode_Format where it failed to properly
+ ignore errors from a __int__() method.
+
- Issue #26494: Fixed crash on iterating exhausting iterators.
Affected classes are generic sequence iterators, iterators of bytearray,
list, tuple, set, frozenset, dict, OrderedDict and corresponding views.
}
else {
iobj = PyNumber_Int(v);
- if (iobj==NULL) iobj = PyNumber_Long(v);
+ if (iobj==NULL) {
+ PyErr_Clear();
+ iobj = PyNumber_Long(v);
+ }
}
if (iobj!=NULL) {
if (PyInt_Check(iobj)) {