Commit 0af4916a authored by Tim Peters's avatar Tim Peters

vgetargskeywords: Removed all PyErr_Clear() calls. It's possible that

this routine will report an error now when it didn't before, but, if so,
it's a legitimate error that should never have been suppressed.
parent 077f574d
...@@ -1097,6 +1097,8 @@ vgetargskeywords(PyObject *args, PyObject *keywords, char *format, ...@@ -1097,6 +1097,8 @@ vgetargskeywords(PyObject *args, PyObject *keywords, char *format,
thiskw); thiskw);
return 0; return 0;
} }
else if (PyErr_Occurred())
return 0;
} }
} }
...@@ -1107,9 +1109,10 @@ vgetargskeywords(PyObject *args, PyObject *keywords, char *format, ...@@ -1107,9 +1109,10 @@ vgetargskeywords(PyObject *args, PyObject *keywords, char *format,
for (i = nargs; i < min; i++) { for (i = nargs; i < min; i++) {
if (PyDict_GetItemString(keywords, kwlist[i])) if (PyDict_GetItemString(keywords, kwlist[i]))
len++; len++;
else if (PyErr_Occurred())
return 0;
} }
} }
PyErr_Clear();
/* make sure we got an acceptable number of arguments; the message /* make sure we got an acceptable number of arguments; the message
is a little confusing with keywords since keyword arguments is a little confusing with keywords since keyword arguments
...@@ -1178,8 +1181,9 @@ vgetargskeywords(PyObject *args, PyObject *keywords, char *format, ...@@ -1178,8 +1181,9 @@ vgetargskeywords(PyObject *args, PyObject *keywords, char *format,
} }
converted++; converted++;
} }
else if (PyErr_Occurred())
return 0;
else { else {
PyErr_Clear();
msg = skipitem(&format, p_va); msg = skipitem(&format, p_va);
if (msg) { if (msg) {
seterror(i+1, msg, levels, fname, message); seterror(i+1, msg, levels, fname, message);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment