summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-01-18 13:06:38 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2017-01-18 13:06:38 (GMT)
commit98ccba8344a349d1bbc27718215156478ffa19ed (patch)
tree2fba5b2b372ee75825e00050cc4b02e8912a1f15
parentc89ef828cf1db1b0d87d83b19c5216290daa2813 (diff)
downloadcpython-98ccba8344a349d1bbc27718215156478ffa19ed.zip
cpython-98ccba8344a349d1bbc27718215156478ffa19ed.tar.gz
cpython-98ccba8344a349d1bbc27718215156478ffa19ed.tar.bz2
_PyObject_FastCallKeywords() now checks !PyErr_Occurred()
Issue #29259. All other functions calling functions start with the similar assertion.
-rw-r--r--Objects/abstract.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 4b32fed..1132b84 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));