summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorJeroen Demeyer <J.Demeyer@UGent.be>2019-07-03 10:52:21 (GMT)
committerInada Naoki <songofacandy@gmail.com>2019-07-03 10:52:21 (GMT)
commit469d1a70cecc918499c288fc0e5e3d79711bc5e5 (patch)
treeb4c27aa5feb46a5fa1705f76bbabb77fb38d15d0 /Python
parent74c9dd57771f4f061ee83b069c8e7b37de41246b (diff)
downloadcpython-469d1a70cecc918499c288fc0e5e3d79711bc5e5.zip
cpython-469d1a70cecc918499c288fc0e5e3d79711bc5e5.tar.gz
cpython-469d1a70cecc918499c288fc0e5e3d79711bc5e5.tar.bz2
bpo-37484: use _PyObject_Vectorcall for __exit__ (GH-14557)
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 5d29d41..888749b 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -3314,7 +3314,6 @@ main_loop:
Finally we push the result of the call.
*/
- PyObject *stack[3];
PyObject *exit_func;
PyObject *exc, *val, *tb, *res;
@@ -3351,10 +3350,9 @@ main_loop:
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;