changeset: 106218:ee6e1b1151a8 user: Victor Stinner date: Wed Jan 18 14:06:38 2017 +0100 files: Objects/abstract.c description: _PyObject_FastCallKeywords() now checks !PyErr_Occurred() Issue #29259. All other functions calling functions start with the similar assertion. diff -r a8d35309dcc0 -r ee6e1b1151a8 Objects/abstract.c --- a/Objects/abstract.c Wed Jan 18 14:04:37 2017 +0100 +++ b/Objects/abstract.c Wed Jan 18 14:06:38 2017 +0100 @@ -2482,6 +2482,11 @@ _PyObject_FastCallKeywords(PyObject *callable, PyObject **stack, Py_ssize_t nargs, PyObject *kwnames) { + /* _PyObject_FastCallKeywords() must not be called with an exception set, + because it can clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + assert(nargs >= 0); assert(kwnames == NULL || PyTuple_CheckExact(kwnames));