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:
@@ -751,7 +751,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);
|
||||
|
||||
Reference in New Issue
Block a user