diff options
author | Tim Peters <tim.peters@gmail.com> | 2001-05-30 06:09:50 +0000 |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2001-05-30 06:09:50 +0000 |
commit | c48735628e855141b60eff7ddd37daedcefc342b (patch) | |
tree | dd2cde28c2b599cb49bd758031b142f81172e7b0 /Python/errors.c | |
parent | 72168dcd9501bfa1d740e83b8107181104b90046 (diff) | |
download | cpython-c48735628e855141b60eff7ddd37daedcefc342b.tar.gz |
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
Diffstat (limited to 'Python/errors.c')
-rw-r--r-- | Python/errors.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/errors.c b/Python/errors.c index 8d02b8e262..89d956f977 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; } |