X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/19a97bd6f98edc899ee0c3b2f2c4fe4ee8a0082b..594f0f5bf1355fb8d58f403d3ebacc1c1767c429:/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; }