call PyErr_Clear() when ignoring error from PyNumber_Int (closes #15516)

Patch from Tom Tromey.
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 @@
                     }
                     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)) {