gh-106320: _testcapi avoids private _PyUnicode_EqualToASCIIString() (#106341)

Replace private _PyUnicode_EqualToASCIIString() with public
PyUnicode_CompareWithASCIIString().
This commit is contained in:
Victor Stinner 2023-07-02 23:56:58 +02:00 committed by GitHub
parent c38c66687f
commit 4e3aa7cd31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1100,7 +1100,7 @@ test_string_from_format(PyObject *self, PyObject *Py_UNUSED(ignored))
} \
else if (result == NULL) \
return NULL; \
else if (!_PyUnicode_EqualToASCIIString(result, EXPECTED)) { \
else if (PyUnicode_CompareWithASCIIString(result, EXPECTED) != 0) { \
PyErr_Format(PyExc_AssertionError, \
"test_string_from_format: failed at \"%s\" " \
"expected \"%s\" got \"%s\"", \