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
This commit is contained in:
Tim Peters 2001-05-30 06:09:50 +00:00
parent 6cba3d0e64
commit 024da3545b

View file

@ -75,7 +75,7 @@ PyErr_SetString(PyObject *exception, const char *string)
PyObject *
PyErr_Occurred(void)
{
PyThreadState *tstate = PyThreadState_Get();
PyThreadState *tstate = PyThreadState_GET();
return tstate->curexc_type;
}