summaryrefslogtreecommitdiffstats
path: root/Modules/_testcapimodule.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-11-20 18:32:09 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-11-20 18:32:09 (GMT)
commit2b979bfa3c27636fe298b7c5d8f17354bd2b566c (patch)
tree75935f32b51eaa6e8f47477961ce6b9987d4c02a /Modules/_testcapimodule.c
parent0fc35196bbd2248ee34d3c818b73eb2f864e4083 (diff)
downloadcpython-2b979bfa3c27636fe298b7c5d8f17354bd2b566c.zip
cpython-2b979bfa3c27636fe298b7c5d8f17354bd2b566c.tar.gz
cpython-2b979bfa3c27636fe298b7c5d8f17354bd2b566c.tar.bz2
Use PyUnicode_CompareWithASCIIString() instead of Py_UNICODE_strcmp() to avoid
the deprecate Py_UNICODE type
Diffstat (limited to 'Modules/_testcapimodule.c')
-rw-r--r--Modules/_testcapimodule.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index f1eac91..ab9467e 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; \
} \