Skip to content

Commit

Permalink
bpo-37484: use _PyObject_Vectorcall for __exit__ (pythonGH-14557)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdemeyer authored and methane committed Jul 3, 2019
1 parent 74c9dd5 commit 469d1a7
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -3314,7 +3314,6 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
Finally we push the result of the call.
*/
PyObject *stack[3];
PyObject *exit_func;
PyObject *exc, *val, *tb, *res;

Expand Down Expand Up @@ -3351,10 +3350,9 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
block->b_level--;
}

stack[0] = exc;
stack[1] = val;
stack[2] = tb;
res = _PyObject_FastCall(exit_func, stack, 3);
PyObject *stack[4] = {NULL, exc, val, tb};
res = _PyObject_Vectorcall(exit_func, stack + 1,
3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
Py_DECREF(exit_func);
if (res == NULL)
goto error;
Expand Down

0 comments on commit 469d1a7

Please sign in to comment.