]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/msw/wizard_wrap.cpp
embedded sample compiles again
[wxWidgets.git] / wxPython / src / msw / wizard_wrap.cpp
index 060fd7969d674700c4ea43a9b8c5f0247199a001..930cc16c51a223dd6c6ce1b7ed6cb9aa7a82c364 100644 (file)
@@ -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;
+    }
 }