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:
parent
5ec3b7d422
commit
5a499c711f
1 changed files with 10 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue