diff -r 16c4137a413c Objects/stringobject.c --- a/Objects/stringobject.c Wed Oct 05 22:34:51 2011 +0200 +++ b/Objects/stringobject.c Wed Nov 16 00:33:43 2011 +0100 @@ -4476,7 +4476,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)) {