Skip to content

Commit 469d1a7

Browse files
jdemeyermethane
authored andcommitted
bpo-37484: use _PyObject_Vectorcall for __exit__ (GH-14557)
1 parent 74c9dd5 commit 469d1a7

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

Python/ceval.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3314,7 +3314,6 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
33143314
33153315
Finally we push the result of the call.
33163316
*/
3317-
PyObject *stack[3];
33183317
PyObject *exit_func;
33193318
PyObject *exc, *val, *tb, *res;
33203319

@@ -3351,10 +3350,9 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
33513350
block->b_level--;
33523351
}
33533352

3354-
stack[0] = exc;
3355-
stack[1] = val;
3356-
stack[2] = tb;
3357-
res = _PyObject_FastCall(exit_func, stack, 3);
3353+
PyObject *stack[4] = {NULL, exc, val, tb};
3354+
res = _PyObject_Vectorcall(exit_func, stack + 1,
3355+
3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
33583356
Py_DECREF(exit_func);
33593357
if (res == NULL)
33603358
goto error;

0 commit comments

Comments
 (0)