summaryrefslogtreecommitdiff
path: root/Python/errors.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-11-16 15:41:31 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2016-11-16 15:41:31 +0200
commite8bd51a939b518a09d6feda34ca09b5c0af9ac43 (patch)
treeaf7da6c28456d43c2760dcbe7223001c4a739be5 /Python/errors.c
parent6a51b836949e1efd4ec7fc82eca1bb6cdb5bf7b7 (diff)
parentc12eb2a761dea81905eb2171cdc7aff806403490 (diff)
downloadcpython-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.c4
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;
}