summaryrefslogtreecommitdiffstats
path: root/Python/errors.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-11-06 23:46:04 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-11-06 23:46:04 (GMT)
commitad14ccd047022d09f486d2359a342ffc5e676e5a (patch)
tree8ddf45c544c55f71d3aa1a877bd6b6d136d972f9 /Python/errors.c
parent937114f7043d6a52172a34fe04febcc5ed0eaed9 (diff)
downloadcpython-ad14ccd047022d09f486d2359a342ffc5e676e5a.zip
cpython-ad14ccd047022d09f486d2359a342ffc5e676e5a.tar.gz
cpython-ad14ccd047022d09f486d2359a342ffc5e676e5a.tar.bz2
Issue #19512: add _PyUnicode_CompareWithId() function
_PyUnicode_CompareWithId() is faster than PyUnicode_CompareWithASCIIString() when both strings are equal and interned. Add also _PyId_builtins identifier for "builtins" common string.
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 b92911a..93e4724 100644
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -878,7 +878,7 @@ PyErr_WriteUnraisable(PyObject *obj)
goto done;
}
else {
- if (PyUnicode_CompareWithASCIIString(moduleName, "builtins") != 0) {
+ if (_PyUnicode_CompareWithId(moduleName, &_PyId_builtins) != 0) {
if (PyFile_WriteObject(moduleName, f, Py_PRINT_RAW) < 0)
goto done;
if (PyFile_WriteString(".", f) < 0)