diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-11-07 00:46:04 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-11-07 00:46:04 +0100 |
commit | 36fcb30e4fb853c47112a363d46b9e77f3c5e97d (patch) | |
tree | 6b905a7b9ae84ef377b0cb8bf71199b1dfe310ba /Python/errors.c | |
parent | 05bfe3160e622f7d33904a12c89fe0a155222fff (diff) | |
download | cpython-36fcb30e4fb853c47112a363d46b9e77f3c5e97d.tar.gz |
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.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/errors.c b/Python/errors.c index b92911a034..93e4724680 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) |