reSWIGged

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26504 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2004-03-30 20:09:28 +00:00
parent 73adcb0150
commit 69223c7017
46 changed files with 630 additions and 352 deletions

View 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;
}
}