diff options
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/stringobject.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Objects/stringobject.c b/Objects/stringobject.c index 152ea21..dcab35e 100644 --- a/Objects/stringobject.c +++ b/Objects/stringobject.c @@ -4489,7 +4489,10 @@ PyString_Format(PyObject *format, PyObject *args) } 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)) { |