python: use 'et' as format for ParseTuple with python2
authorNoel Power <noel.power@suse.com>
Tue, 11 Dec 2018 15:58:07 +0000 (15:58 +0000)
committerDouglas Bagnall <dbagnall@samba.org>
Sat, 12 Jan 2019 23:40:26 +0000 (00:40 +0100)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
python/pyglue.c

index e4f961fdaf72c9f0711b903219f5c3eb8f035bf4..70e211606ffba29bf598631a57a7ddb3cdabd30e 100644 (file)
@@ -301,7 +301,9 @@ static PyObject *py_strcasecmp_m(PyObject *self, PyObject *args)
        const char *s1 = NULL;
        const char *s2 = NULL;
        long cmp_result = 0;
-       if (!PyArg_ParseTuple(args, "eses", "utf8", &s1, "utf8", &s2)) {
+       if (!PyArg_ParseTuple(args, PYARG_STR_UNI
+                             PYARG_STR_UNI,
+                             "utf8", &s1, "utf8", &s2)) {
                return NULL;
        }
 
@@ -317,7 +319,9 @@ static PyObject *py_strstr_m(PyObject *self, PyObject *args)
        const char *s2 = NULL;
        char *strstr_ret = NULL;
        PyObject *result = NULL;
-       if (!PyArg_ParseTuple(args, "eses", "utf8", &s1, "utf8", &s2))
+       if (!PyArg_ParseTuple(args, PYARG_STR_UNI
+                             PYARG_STR_UNI,
+                             "utf8", &s1, "utf8", &s2))
                return NULL;
 
        strstr_ret = strstr_m(s1, s2);