From: Tim Peters Date: Wed, 30 May 2001 06:09:50 +0000 (+0000) Subject: PyErr_Occurred(): Use PyThreadState_GET(), which saves a tiny function call X-Git-Tag: v2.2a3~1637 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=024da3545b9a47101c3757e3ee90b0fcf4db0a18;p=thirdparty%2FPython%2Fcpython.git 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 --- diff --git a/Python/errors.c b/Python/errors.c index 8d02b8e26221..89d956f97770 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -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; }