]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/my_typemaps.i
reSWIGged
[wxWidgets.git] / wxPython / src / my_typemaps.i
index 331ccc07eb32305a60faf8bdf883a1bac2e8dbbb..958ac1eac5bd1fb058930185d4f3ad5858e2f5a2 100644 (file)
@@ -242,6 +242,10 @@ MAKE_INT_ARRAY_TYPEMAPS(styles, styles_field)
     for (i=0; i<len; i++) {
         PyObject* item = PySequence_GetItem($input, i);
         PyObject* number  = PyNumber_Int(item);
+        if (!number) {
+            PyErr_SetString(PyExc_TypeError, "Sequence of integers expected.");
+            SWIG_fail;
+        }       
         $1->Add(PyInt_AS_LONG(number));
         Py_DECREF(item);
         Py_DECREF(number);