mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +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:
commit
29a5447360
5 changed files with 65 additions and 8 deletions
|
@ -984,7 +984,7 @@ PyErr_WriteUnraisable(PyObject *obj)
|
|||
goto done;
|
||||
}
|
||||
else {
|
||||
if (_PyUnicode_CompareWithId(moduleName, &PyId_builtins) != 0) {
|
||||
if (!_PyUnicode_EqualToASCIIId(moduleName, &PyId_builtins)) {
|
||||
if (PyFile_WriteObject(moduleName, f, Py_PRINT_RAW) < 0)
|
||||
goto done;
|
||||
if (PyFile_WriteString(".", f) < 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue