X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/34a1d7328f198b5ad31c33a07a6078f089feb45f..ecc08ead918856a70559204f9b5daacc49385eaa:/wxPython/src/helpers.cpp diff --git a/wxPython/src/helpers.cpp b/wxPython/src/helpers.cpp index c9994a4cfb..0d7aa40850 100644 --- a/wxPython/src/helpers.cpp +++ b/wxPython/src/helpers.cpp @@ -1011,11 +1011,24 @@ wxString* wxString_LIST_helper(PyObject* source) { } for (int x=0; x= 1009 + if (! PyString_Check(o) && ! PyUnicode_Check(o)) { + PyErr_SetString(PyExc_TypeError, "Expected a list of string or unicode objects."); + return NULL; + } + + char* buff; + int length; + if (PyString_AsStringAndSize(o, &buff, &length) == -1) + return NULL; + temp[x] = wxString(buff, length); +#else if (! PyString_Check(o)) { PyErr_SetString(PyExc_TypeError, "Expected a list of strings."); return NULL; } temp[x] = PyString_AsString(o); +#endif } return temp; }