X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/823f0cfe616bd32f543b6fd7ae5f5ed392b084ac..ad3fca675f77c2903cafd096bbda8baa2e7689ff:/wxPython/src/gtk/wizard_wrap.cpp diff --git a/wxPython/src/gtk/wizard_wrap.cpp b/wxPython/src/gtk/wizard_wrap.cpp index 060fd7969d..5ea11866ae 100644 --- a/wxPython/src/gtk/wizard_wrap.cpp +++ b/wxPython/src/gtk/wizard_wrap.cpp @@ -320,7 +320,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; + } } @@ -797,11 +805,12 @@ static PyObject *_wrap_new_PyWizardPage(PyObject *self, PyObject *args, PyObject } } { + if (!wxPyCheckForApp()) SWIG_fail; PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxPyWizardPage *)new_wxPyWizardPage(arg1,(wxBitmap const *)arg2,(wxString const *)arg3); wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; + if (PyErr_Occurred()) SWIG_fail; } resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxPyWizardPage, 1); { @@ -827,11 +836,12 @@ static PyObject *_wrap_new_PrePyWizardPage(PyObject *self, PyObject *args, PyObj if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":new_PrePyWizardPage",kwnames)) goto fail; { + if (!wxPyCheckForApp()) SWIG_fail; PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxPyWizardPage *)new wxPyWizardPage(); wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; + if (PyErr_Occurred()) SWIG_fail; } resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxPyWizardPage, 1); return resultobj; @@ -1568,11 +1578,12 @@ static PyObject *_wrap_new_WizardPageSimple(PyObject *self, PyObject *args, PyOb SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; } { + if (!wxPyCheckForApp()) SWIG_fail; PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxWizardPageSimple *)new wxWizardPageSimple(arg1,arg2,arg3,(wxBitmap const &)*arg4,(wxChar const *)arg5); wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; + if (PyErr_Occurred()) SWIG_fail; } resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxWizardPageSimple, 1); return resultobj; @@ -1590,11 +1601,12 @@ static PyObject *_wrap_new_PreWizardPageSimple(PyObject *self, PyObject *args, P if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":new_PreWizardPageSimple",kwnames)) goto fail; { + if (!wxPyCheckForApp()) SWIG_fail; PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxWizardPageSimple *)new wxWizardPageSimple(); wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; + if (PyErr_Occurred()) SWIG_fail; } resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxWizardPageSimple, 1); return resultobj; @@ -1819,11 +1831,12 @@ static PyObject *_wrap_new_Wizard(PyObject *self, PyObject *args, PyObject *kwar if (PyErr_Occurred()) SWIG_fail; } { + if (!wxPyCheckForApp()) SWIG_fail; PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxWizard *)new wxWizard(arg1,arg2,(wxString const &)*arg3,(wxBitmap const &)*arg4,(wxPoint const &)*arg5,arg6); wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; + if (PyErr_Occurred()) SWIG_fail; } resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxWizard, 1); { @@ -1849,11 +1862,12 @@ static PyObject *_wrap_new_PreWizard(PyObject *self, PyObject *args, PyObject *k if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)":new_PreWizard",kwnames)) goto fail; { + if (!wxPyCheckForApp()) SWIG_fail; PyThreadState* __tstate = wxPyBeginAllowThreads(); result = (wxWizard *)new wxWizard(); wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; + if (PyErr_Occurred()) SWIG_fail; } resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxWizard, 1); return resultobj;