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:
Serhiy Storchaka 2016-11-16 10:19:20 +02:00
commit 3b73ea1278
22 changed files with 125 additions and 80 deletions

View file

@ -2329,7 +2329,7 @@ test_string_from_format(PyObject *self, PyObject *args)
result = PyUnicode_FromFormat(FORMAT, (TYPE)1); \
if (result == NULL) \
return NULL; \
if (PyUnicode_CompareWithASCIIString(result, "1")) { \
if (!_PyUnicode_EqualToASCIIString(result, "1")) { \
msg = FORMAT " failed at 1"; \
goto Fail; \
} \