]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/contrib/glcanvas/mac/glcanvas_wrap.cpp
Add width and precision params for wxGridCellFloatEditor
[wxWidgets.git] / wxPython / contrib / glcanvas / mac / glcanvas_wrap.cpp
index 1a4e714f6c97df879aba8baf9b695d4f33ce7b1b..d84670aaed8ebf897af14534092fc70dd9d7be89 100644 (file)
@@ -332,7 +332,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;
+    }
 }