]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Use PyUnicode_CompareWithASCIIString() instead of Py_UNICODE_strcmp() to avoid
authorVictor Stinner <victor.stinner@haypocalc.com>
Sun, 20 Nov 2011 18:32:09 +0000 (19:32 +0100)
committerVictor Stinner <victor.stinner@haypocalc.com>
Sun, 20 Nov 2011 18:32:09 +0000 (19:32 +0100)
the deprecate Py_UNICODE type

Modules/_testcapimodule.c

index f1eac91d488fe72dfdba287d30586c65968c3cba..ab9467e484d4d794a0c1a488ebadc6cc9978fa2b 100644 (file)
@@ -1803,13 +1803,12 @@ test_string_from_format(PyObject *self, PyObject *args)
 {
     PyObject *result;
     char *msg;
-    static const Py_UNICODE one[] = {'1', 0};
 
 #define CHECK_1_FORMAT(FORMAT, TYPE)                                \
     result = PyUnicode_FromFormat(FORMAT, (TYPE)1);                 \
     if (result == NULL)                                             \
         return NULL;                                                \
-    if (Py_UNICODE_strcmp(PyUnicode_AS_UNICODE(result), one)) {     \
+    if (PyUnicode_CompareWithASCIIString(result, "1")) {     \
         msg = FORMAT " failed at 1";                                \
         goto Fail;                                                  \
     }                                                               \