Fix for METH_O and -compactdefaultargs, in two parts:
- Don't mark a method as METH_O if it has compactdefaultargs - In SWIG_Python_UnpackTuple, allow for a non-tuple 'args'. Added compatibility for python versions 2.3 and 2.4. These are only partially supported; inheriting from wrapped types looks problematic. Versions older that 2.3 are unlikely ever to work. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12590 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
48faf20934
commit
90fe22acf7
6 changed files with 63 additions and 7 deletions
|
|
@ -166,6 +166,14 @@ SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssi
|
|||
}
|
||||
}
|
||||
if (!PyTuple_Check(args)) {
|
||||
if (min <= 1 && max >= 1) {
|
||||
objs[0] = args;
|
||||
register int i;
|
||||
for (i = 1; i < max; ++i) {
|
||||
objs[i] = 0;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
|
||||
return 0;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue