summaryrefslogtreecommitdiff
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-11-16 15:40:39 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2016-11-16 15:40:39 +0200
commit5c2da4afb4eb80ca374451b71114cda455c9d11b (patch)
treebd91396bb27469aa217835643cdf08a3c4186e13 /Python/pythonrun.c
parent78779b765c2d7f89fab3868b77b6a6522c55ee4c (diff)
downloadcpython-5c2da4afb4eb80ca374451b71114cda455c9d11b.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/pythonrun.c')
-rw-r--r--Python/pythonrun.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 7fbf06e68a..72b6c9b060 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -747,7 +747,7 @@ print_exception(PyObject *f, PyObject *value)
err = PyFile_WriteString("<unknown>", f);
}
else {
- if (_PyUnicode_CompareWithId(moduleName, &PyId_builtins) != 0)
+ if (!_PyUnicode_EqualToASCIIId(moduleName, &PyId_builtins))
{
err = PyFile_WriteObject(moduleName, f, Py_PRINT_RAW);
err += PyFile_WriteString(".", f);