mirror of
https://github.com/python/cpython.git
synced 2025-09-24 17:33:29 +00:00
call PyErr_Clear() when ignoring error from PyNumber_Int (closes #15516)
Patch from Tom Tromey.
This commit is contained in:
parent
140794d6e7
commit
a708adfcf6
3 changed files with 17 additions and 1 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue