From: Victor Stinner Date: Sun, 20 Nov 2011 18:32:09 +0000 (+0100) Subject: Use PyUnicode_CompareWithASCIIString() instead of Py_UNICODE_strcmp() to avoid X-Git-Tag: v3.3.0a1~790 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2b979bfa3c27636fe298b7c5d8f17354bd2b566c;p=thirdparty%2FPython%2Fcpython.git Use PyUnicode_CompareWithASCIIString() instead of Py_UNICODE_strcmp() to avoid the deprecate Py_UNICODE type --- diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index f1eac91d488f..ab9467e484d4 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -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; \ } \