]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-106320: _testcapi avoids private _PyUnicode_EqualToASCIIString() (#106341)
authorVictor Stinner <vstinner@python.org>
Sun, 2 Jul 2023 21:56:58 +0000 (23:56 +0200)
committerGitHub <noreply@github.com>
Sun, 2 Jul 2023 21:56:58 +0000 (21:56 +0000)
Replace private _PyUnicode_EqualToASCIIString() with public
PyUnicode_CompareWithASCIIString().

Modules/_testcapi/unicode.c

index 367d2af1413e57fede950fdb711852d2432cc951..9c2760c3f763a61d23cbcffa95d7244fb5dd40f3 100644 (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\"",                  \