comparison Python/errors.c @ 18007:6a2e2548e6cf legacy-trunk

PyErr_Occurred(): Use PyThreadState_GET(), which saves a tiny function call in release builds. Suggested by Martin v. Loewis. I'm half tempted to macroize PyErr_Occurred too, as the whole thing could collapse to just _PyThreadState_Current->curexc_type
author Tim Peters <tim.peters@gmail.com>
date Wed, 30 May 2001 06:09:50 +0000
parents 86fd723f2928
children e1c91ac55cca
comparison
equal deleted inserted replaced
18006:e60fc01762a0 18007:6a2e2548e6cf
73 73
74 74
75 PyObject * 75 PyObject *
76 PyErr_Occurred(void) 76 PyErr_Occurred(void)
77 { 77 {
78 PyThreadState *tstate = PyThreadState_Get(); 78 PyThreadState *tstate = PyThreadState_GET();
79 79
80 return tstate->curexc_type; 80 return tstate->curexc_type;
81 } 81 }
82 82
83 83