diff options
Diffstat (limited to 'Objects/unicodeobject.c')
| -rw-r--r-- | Objects/unicodeobject.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 454451e..d06ce2c 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -8632,7 +8632,10 @@ PyObject *PyUnicode_Format(PyObject *format, } 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)) { |
