summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-10-27 06:14:32 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-10-27 06:14:32 (GMT)
commit0af4916ad42f0a5eec08b81adf9971e3b8e4a629 (patch)
tree08fd17be909ed21892ae1b4a2b402dd8fd02ef15
parent077f574db1b76484690fd46ddf342ec7e80f929a (diff)
downloadcpython-0af4916ad42f0a5eec08b81adf9971e3b8e4a629.zip
cpython-0af4916ad42f0a5eec08b81adf9971e3b8e4a629.tar.gz
cpython-0af4916ad42f0a5eec08b81adf9971e3b8e4a629.tar.bz2
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.
-rw-r--r--Python/getargs.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/Python/getargs.c b/Python/getargs.c
index 5c78dd7..3306eb6 100644
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -1097,6 +1097,8 @@ vgetargskeywords(PyObject *args, PyObject *keywords, char *format,
thiskw);
return 0;
}
+ else if (PyErr_Occurred())
+ return 0;
}
}
@@ -1107,10 +1109,11 @@ vgetargskeywords(PyObject *args, PyObject *keywords, char *format,
for (i = nargs; i < min; i++) {
if (PyDict_GetItemString(keywords, kwlist[i]))
len++;
+ else if (PyErr_Occurred())
+ return 0;
}
}
- PyErr_Clear();
-
+
/* make sure we got an acceptable number of arguments; the message
is a little confusing with keywords since keyword arguments
which are supplied, but don't match the required arguments
@@ -1159,7 +1162,7 @@ vgetargskeywords(PyObject *args, PyObject *keywords, char *format,
"number of items in format string and keyword list do not match");
return 0;
}
-
+
/* convert the keyword arguments; this uses the format
string where it was left after processing args */
converted = 0;
@@ -1178,8 +1181,9 @@ vgetargskeywords(PyObject *args, PyObject *keywords, char *format,
}
converted++;
}
+ else if (PyErr_Occurred())
+ return 0;
else {
- PyErr_Clear();
msg = skipitem(&format, p_va);
if (msg) {
seterror(i+1, msg, levels, fname, message);