From 59b356d659b29d962feb86e61d4890a6cee9e172 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 16 Mar 2015 11:52:32 +0100 Subject: 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 :-( --- Python/ceval.c | 7 +++++++ 1 file changed, 7 insertions(+) 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) -- cgit v0.12