diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-11-16 15:41:31 +0200 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-11-16 15:41:31 +0200 |
commit | e8bd51a939b518a09d6feda34ca09b5c0af9ac43 (patch) | |
tree | af7da6c28456d43c2760dcbe7223001c4a739be5 /Python/errors.c | |
parent | 6a51b836949e1efd4ec7fc82eca1bb6cdb5bf7b7 (diff) | |
parent | c12eb2a761dea81905eb2171cdc7aff806403490 (diff) | |
download | cpython-e8bd51a939b518a09d6feda34ca09b5c0af9ac43.tar.gz |
Issue #28701: Replace _PyUnicode_CompareWithId with _PyUnicode_EqualToASCIIId.
The latter function is more readable, faster and doesn't raise exceptions.
Based on patch by Xiang Zhang.
Diffstat (limited to 'Python/errors.c')
-rw-r--r-- | Python/errors.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/errors.c b/Python/errors.c index 7b25a2202c..1463cdca3f 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -158,10 +158,10 @@ PyErr_SetString(PyObject *exception, const char *string) } -PyObject * +PyObject* _Py_HOT_FUNCTION PyErr_Occurred(void) { - PyThreadState *tstate = _PyThreadState_UncheckedGet(); + PyThreadState *tstate = PyThreadState_GET(); return tstate == NULL ? NULL : tstate->curexc_type; } |