mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
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:
parent
6cba3d0e64
commit
024da3545b
1 changed files with 1 additions and 1 deletions
|
@ -75,7 +75,7 @@ PyErr_SetString(PyObject *exception, const char *string)
|
||||||
PyObject *
|
PyObject *
|
||||||
PyErr_Occurred(void)
|
PyErr_Occurred(void)
|
||||||
{
|
{
|
||||||
PyThreadState *tstate = PyThreadState_Get();
|
PyThreadState *tstate = PyThreadState_GET();
|
||||||
|
|
||||||
return tstate->curexc_type;
|
return tstate->curexc_type;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue