File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -630,8 +630,13 @@ PyErr_PrintEx(int set_sys_last_vars)
630630 }
631631 hook = _PySys_GetObjectId (& PyId_excepthook );
632632 if (hook ) {
633- PyObject * args = PyTuple_Pack (3 , exception , v , tb );
634- PyObject * result = PyEval_CallObject (hook , args );
633+ PyObject * stack [3 ];
634+ PyObject * result ;
635+
636+ stack [0 ] = exception ;
637+ stack [1 ] = v ;
638+ stack [2 ] = tb ;
639+ result = _PyObject_FastCall (hook , stack , 3 , NULL );
635640 if (result == NULL ) {
636641 PyObject * exception2 , * v2 , * tb2 ;
637642 if (PyErr_ExceptionMatches (PyExc_SystemExit )) {
@@ -660,7 +665,6 @@ PyErr_PrintEx(int set_sys_last_vars)
660665 Py_XDECREF (tb2 );
661666 }
662667 Py_XDECREF (result );
663- Py_XDECREF (args );
664668 } else {
665669 PySys_WriteStderr ("sys.excepthook is missing\n" );
666670 PyErr_Display (exception , v , tb );
You can’t perform that action at this time.
0 commit comments