summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-05-30 06:09:50 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-05-30 06:09:50 (GMT)
commit024da3545b9a47101c3757e3ee90b0fcf4db0a18 (patch)
treeb0bebf01fa534d7df62aa21badbcc25358fc39b0
parent6cba3d0e64453a8e567f3ef155f0263f48634c72 (diff)
downloadcpython-024da3545b9a47101c3757e3ee90b0fcf4db0a18.zip
cpython-024da3545b9a47101c3757e3ee90b0fcf4db0a18.tar.gz
cpython-024da3545b9a47101c3757e3ee90b0fcf4db0a18.tar.bz2
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
-rw-r--r--Python/errors.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/errors.c b/Python/errors.c
index 8d02b8e..89d956f 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;
}