summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 8e3fbe3..56d771f 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -979,12 +979,6 @@ static PyObject *
call_trampoline(PyThreadState *tstate, PyObject* callback,
PyFrameObject *frame, int what, PyObject *arg)
{
-
- PyObject *stack[3];
- stack[0] = (PyObject *)frame;
- stack[1] = whatstrings[what];
- stack[2] = (arg != NULL) ? arg : Py_None;
-
/* Discard any previous modifications the frame's fast locals */
if (frame->f_fast_as_locals) {
if (PyFrame_FastToLocalsWithError(frame) < 0) {
@@ -993,7 +987,11 @@ call_trampoline(PyThreadState *tstate, PyObject* callback,
}
/* call the Python-level function */
- PyObject *result = _PyObject_FastCallTstate(tstate, callback, stack, 3);
+ if (arg == NULL) {
+ arg = Py_None;
+ }
+ PyObject *args[3] = {(PyObject *)frame, whatstrings[what], arg};
+ PyObject *result = _PyObject_VectorcallTstate(tstate, callback, args, 3, NULL);
PyFrame_LocalsToFast(frame, 1);
return result;