diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-03-16 10:52:32 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-03-16 10:52:32 (GMT) |
commit | 59b356d659b29d962feb86e61d4890a6cee9e172 (patch) | |
tree | 640c3e6bc348c50b0e5a1b9137bb76880a10d178 /Python/ceval.c | |
parent | b8a78d3d857573ec21162e004b48288f7ad43d89 (diff) | |
download | cpython-59b356d659b29d962feb86e61d4890a6cee9e172.zip cpython-59b356d659b29d962feb86e61d4890a6cee9e172.tar.gz cpython-59b356d659b29d962feb86e61d4890a6cee9e172.tar.bz2 |
Issue #23571: Restore removed assert(!PyErr_Occurred()); in
PyEval_CallObjectWithKeywords()
Sorry Serhiy, I missed your explanation because the review email was moved to
my Spam folder :-(
Diffstat (limited to 'Python/ceval.c')
-rw-r--r-- | Python/ceval.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 1c6089d..25fbc0f 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -4118,6 +4118,13 @@ PyEval_CallObjectWithKeywords(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; +#ifdef Py_DEBUG + /* PyEval_CallObjectWithKeywords() must not be called with an exception + set. It raises a new exception if parameters are invalid or if + PyTuple_New() fails, and so the original exception is lost. */ + assert(!PyErr_Occurred()); +#endif + if (arg == NULL) { arg = PyTuple_New(0); if (arg == NULL) |