summaryrefslogtreecommitdiffstats
path: root/Python/errors.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-11-16 13:41:11 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-11-16 13:41:11 (GMT)
commitfab6acd9f58584d2f4b361418e4d17f9c23db2f9 (patch)
treeaee38e54448d48d8652ab4c62792ca414d4653f3 /Python/errors.c
parent3b73ea127892d0e1f9d8f12f88e4f9c0ba0b89b1 (diff)
parentf5894dd646f5e39918377b37b8c8694cebdca103 (diff)
downloadcpython-fab6acd9f58584d2f4b361418e4d17f9c23db2f9.zip
cpython-fab6acd9f58584d2f4b361418e4d17f9c23db2f9.tar.gz
cpython-fab6acd9f58584d2f4b361418e4d17f9c23db2f9.tar.bz2
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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/errors.c b/Python/errors.c
index 918f4df..7b25a22 100644
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -984,7 +984,7 @@ PyErr_WriteUnraisable(PyObject *obj)
goto done;
}
else {
- if (_PyUnicode_CompareWithId(moduleName, &PyId_builtins) != 0) {
+ if (!_PyUnicode_EqualToASCIIId(moduleName, &PyId_builtins)) {
if (PyFile_WriteObject(moduleName, f, Py_PRINT_RAW) < 0)
goto done;
if (PyFile_WriteString(".", f) < 0)