diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-01-18 14:06:38 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2017-01-18 14:06:38 +0100 |
commit | 74d6d9a64feed656f54ca069e3ccc6e4bf1db270 (patch) | |
tree | 866e3e4716a566ce964a1a17414db77e5462e2ed | |
parent | 0d1ea345cf7da0978f5cb8e76a843506a8278a39 (diff) | |
download | cpython-74d6d9a64feed656f54ca069e3ccc6e4bf1db270.tar.gz |
_PyObject_FastCallKeywords() now checks !PyErr_Occurred()
Issue #29259. All other functions calling functions start with the similar
assertion.
-rw-r--r-- | Objects/abstract.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c index 4b32fedccf..1132b842ca 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -2482,6 +2482,11 @@ PyObject * _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)); |