File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -368,34 +368,25 @@ static PyObject *
368368call_trampoline (PyObject * callback ,
369369 PyFrameObject * frame , int what , PyObject * arg )
370370{
371- PyObject * args ;
372- PyObject * whatstr ;
373371 PyObject * result ;
372+ PyObject * stack [3 ];
374373
375- args = PyTuple_New (3 );
376- if (args == NULL )
377- return NULL ;
378- if (PyFrame_FastToLocalsWithError (frame ) < 0 )
374+ if (PyFrame_FastToLocalsWithError (frame ) < 0 ) {
379375 return NULL ;
376+ }
380377
381- Py_INCREF (frame );
382- whatstr = whatstrings [what ];
383- Py_INCREF (whatstr );
384- if (arg == NULL )
385- arg = Py_None ;
386- Py_INCREF (arg );
387- PyTuple_SET_ITEM (args , 0 , (PyObject * )frame );
388- PyTuple_SET_ITEM (args , 1 , whatstr );
389- PyTuple_SET_ITEM (args , 2 , arg );
378+ stack [0 ] = (PyObject * )frame ;
379+ stack [1 ] = whatstrings [what ];
380+ stack [2 ] = (arg != NULL ) ? arg : Py_None ;
390381
391382 /* call the Python-level function */
392- result = PyEval_CallObject (callback , args );
383+ result = _PyObject_FastCall (callback , stack , 3 , NULL );
384+
393385 PyFrame_LocalsToFast (frame , 1 );
394- if (result == NULL )
386+ if (result == NULL ) {
395387 PyTraceBack_Here (frame );
388+ }
396389
397- /* cleanup */
398- Py_DECREF (args );
399390 return result ;
400391}
401392
You can’t perform that action at this time.
0 commit comments