fix checking for noargs

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8719 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2006-02-05 04:11:40 +00:00
commit 5a499c711f

View file

@ -170,7 +170,16 @@ SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
SWIGINTERN int
SWIG_Python_UnpackTuple(PyObject *args, const char *name, int min, int max, PyObject **objs)
{
{
if (!args) {
if (!min && !max) {
return 1;
} else {
PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none",
name, (min == max ? "" : "at least "), min);
return 0;
}
}
if (!PyTuple_Check(args)) {
PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
return 0;