mirror of
https://github.com/python/cpython.git
synced 2025-07-08 20:05:28 +00:00
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.
This commit is contained in:
parent
f4934ea77d
commit
f5894dd646
5 changed files with 65 additions and 8 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue