Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 59b356d

Browse files
committed
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 :-(
1 parent b8a78d3 commit 59b356d

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Python/ceval.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4118,6 +4118,13 @@ PyEval_CallObjectWithKeywords(PyObject *func, PyObject *arg, PyObject *kw)
41184118
{
41194119
PyObject *result;
41204120

4121+
#ifdef Py_DEBUG
4122+
/* PyEval_CallObjectWithKeywords() must not be called with an exception
4123+
set. It raises a new exception if parameters are invalid or if
4124+
PyTuple_New() fails, and so the original exception is lost. */
4125+
assert(!PyErr_Occurred());
4126+
#endif
4127+
41214128
if (arg == NULL) {
41224129
arg = PyTuple_New(0);
41234130
if (arg == NULL)

0 commit comments

Comments
 (0)