diff options
Diffstat (limited to 'sip/qt/qstrlist.sip')
-rw-r--r-- | sip/qt/qstrlist.sip | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sip/qt/qstrlist.sip b/sip/qt/qstrlist.sip index 0fd3976..695c872 100644 --- a/sip/qt/qstrlist.sip +++ b/sip/qt/qstrlist.sip @@ -57,7 +57,7 @@ is used instead. { PyObject *ps; - if ((ps = PyString_FromString(s)) == NULL || PyList_SetItem(l,i,ps) < 0) + if ((ps = SIPBytes_FromString(s)) == NULL || PyList_SetItem(l,i,ps) < 0) { Py_XDECREF(ps); Py_DECREF(l); @@ -80,13 +80,17 @@ is used instead. for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) { + PyObject *object = PyList_GET_ITEM(sipPy, i); char *s; - if ((s = PyString_AsString(PyList_GET_ITEM(sipPy,i))) == NULL) + if (PyUnicode_Check(object)) + { + s = tqstrdup(sipString_AsLatin1String(&object)); + } + else if ((s = (char *)sipBytes_AsString(object)) == NULL) { *sipIsErr = 1; delete qsl; - return 0; } |