X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/faf3cb3590e7bead27735c94014df39025cfc12b..8b53e5a2261d192bce49d40f0019f52f73b1557a:/utils/wxPython/src/helpers.cpp diff --git a/utils/wxPython/src/helpers.cpp b/utils/wxPython/src/helpers.cpp index a89b3502e8..8ffbd7931a 100644 --- a/utils/wxPython/src/helpers.cpp +++ b/utils/wxPython/src/helpers.cpp @@ -370,6 +370,29 @@ void wxPyTimer::Notify() { // imcluded in every file... +byte* byte_LIST_helper(PyObject* source) { + if (!PyList_Check(source)) { + PyErr_SetString(PyExc_TypeError, "Expected a list object."); + return NULL; + } + int count = PyList_Size(source); + byte* temp = new byte[count]; + if (! temp) { + PyErr_SetString(PyExc_MemoryError, "Unable to allocate temporary array"); + return NULL; + } + for (int x=0; x