]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/gtk/streams.cpp
added wxLogError to wxCSConv so that it complains if the encoding is unknown
[wxWidgets.git] / wxPython / src / gtk / streams.cpp
index b4efd336e519b34e4dafa28957ae2c7ea460ae8f..cb5d371d1a8d7dfdf89b7446787456c9b29f2f04 100644 (file)
@@ -105,7 +105,11 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) {
     return target;
 }
 
-static char* wxStringErrorMsg = "string type is required for parameter";
+#if PYTHON_API_VERSION >= 1009
+    static char* wxStringErrorMsg = "String or Unicode type required";
+#else
+    static char* wxStringErrorMsg = "string type is required for parameter";
+#endif
   // C++
 // definitions of wxStringPtrList and wxPyInputStream
 #include <wx/listimpl.cpp>
@@ -708,7 +712,7 @@ static PyObject *_wrap_wxOutputStream_write(PyObject *self, PyObject *args, PyOb
 #if PYTHON_API_VERSION >= 1009
     char* tmpPtr; int tmpSize;
     if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
-        PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
+        PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
         return NULL;
     }
     if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)