From 4ce11cc30df1805459a615960fdec204a975548a Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Tue, 3 Jan 2023 15:29:41 +0900 Subject: Drop python2 support. Signed-off-by: Michele Calgaro --- sip/tdeui/keditlistbox.sip | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'sip/tdeui/keditlistbox.sip') diff --git a/sip/tdeui/keditlistbox.sip b/sip/tdeui/keditlistbox.sip index 6fd3391..526db68 100644 --- a/sip/tdeui/keditlistbox.sip +++ b/sip/tdeui/keditlistbox.sip @@ -176,7 +176,7 @@ public: const char **PyTQtListToArray(PyObject *lst) { - int nstr; + SIP_SSIZE_T nstr; const char **str, **sp; nstr = PyList_Size(lst); @@ -190,15 +190,16 @@ const char **PyTQtListToArray(PyObject *lst) for (int i = 0; i < nstr; ++i) { - char *s; + PyObject *item = PyList_GetItem(lst, i); + const char *item_ascii = sipString_AsASCIIString(&item); - if ((s = PyString_AsString(PyList_GetItem(lst,i))) == NULL) + if (item_ascii == NULL) { sipFree((void *)str); return NULL; } - *sp++ = s; + *sp++ = item_ascii; } return str; -- cgit v1.2.1