Skip to content

Commit bdd4a2f

Browse files
committed
_PyObject_FastCallKeywords() now checks !PyErr_Occurred()
Issue #29259. All other functions calling functions start with the similar assertion.
1 parent dcc2a62 commit bdd4a2f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Objects/abstract.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2482,6 +2482,11 @@ PyObject *
24822482
_PyObject_FastCallKeywords(PyObject *callable, PyObject **stack, Py_ssize_t nargs,
24832483
PyObject *kwnames)
24842484
{
2485+
/* _PyObject_FastCallKeywords() must not be called with an exception set,
2486+
because it can clear it (directly or indirectly) and so the
2487+
caller loses its exception */
2488+
assert(!PyErr_Occurred());
2489+
24852490
assert(nargs >= 0);
24862491
assert(kwnames == NULL || PyTuple_CheckExact(kwnames));
24872492

0 commit comments

Comments
 (0)