]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/contrib/iewin/iewin_wrap.cpp
undo last change
[wxWidgets.git] / wxPython / contrib / iewin / iewin_wrap.cpp
index 6523504c2e4215f52cce8fb19d87eb0abcc627de..d3c535df79ea6102d9bda193c9efc0ffa0d767d8 100644 (file)
@@ -310,7 +310,15 @@ SWIG_CheckLongInRange(long value, const char* type,
 SWIGSTATICINLINE(long)
 SWIG_AsLong(PyObject * obj)
 {
-  return PyInt_Check(obj) ? PyInt_AsLong(obj) : PyLong_AsLong(obj);
+    if (PyNumber_Check(obj))
+        return PyInt_AsLong(obj);
+    else {
+        PyObject* errmsg = PyString_FromFormat("Expected number, got %s",
+                                               obj->ob_type->tp_name);
+        PyErr_SetObject(PyExc_TypeError, errmsg);
+        Py_DECREF(errmsg);
+        return 0;
+    }
 }
 
 
@@ -556,6 +564,7 @@ static PyObject *_wrap_new_IEHtmlWin(PyObject *self, PyObject *args, PyObject *k
         }
     }
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxIEHtmlWin *)new wxIEHtmlWin(arg1,arg2,(wxPoint const &)*arg3,(wxSize const &)*arg4,arg5,(wxString const &)*arg6);