mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
Issue #28701: Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString.
The latter function is more readable, faster and doesn't raise exceptions.
This commit is contained in:
parent
5ebff7b300
commit
f4934ea77d
21 changed files with 120 additions and 75 deletions
|
|
@ -1675,7 +1675,7 @@ whichmodule(PyObject *global, PyObject *dotted_path)
|
|||
while (PyDict_Next(modules_dict, &i, &module_name, &module)) {
|
||||
PyObject *candidate;
|
||||
if (PyUnicode_Check(module_name) &&
|
||||
!PyUnicode_CompareWithASCIIString(module_name, "__main__"))
|
||||
_PyUnicode_EqualToASCIIString(module_name, "__main__"))
|
||||
continue;
|
||||
if (module == Py_None)
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue