From 6f3f4fbdf163cef537960620e48190f36ad2c08b Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Thu, 6 Oct 2022 10:56:04 +1300 Subject: [Python] Remove deprecated and apparently useless defarg.swg The only documentation is in the file itself and describes a Python wrapper around the C function defined here, but digging though the git history this Python wrapper doesn't seem to have ever actually been generated by SWIG. This file was also marked as deprecated in 2005. Fixes #2390 Fixes #2391 --- Lib/python/README | 1 - Lib/python/defarg.swg | 37 ------------------------------------- 2 files changed, 38 deletions(-) delete mode 100644 Lib/python/defarg.swg (limited to 'Lib') diff --git a/Lib/python/README b/Lib/python/README index fa8ef61e7..70968e7dd 100644 --- a/Lib/python/README +++ b/Lib/python/README @@ -101,4 +101,3 @@ std_container.i general common code for the STD/STL containers std_vectora.i vector + allocator (allocators are now supported in STD/STL) typemaps.i old in/out typemaps (doesn't need to be included) -defarg.swg for processing default arguments with shadow classes diff --git a/Lib/python/defarg.swg b/Lib/python/defarg.swg deleted file mode 100644 index ba5ff43d4..000000000 --- a/Lib/python/defarg.swg +++ /dev/null @@ -1,37 +0,0 @@ -/* This file defines an internal function for processing default arguments - with proxy classes. - - There seems to be no straightforward way to write proxy functions - involving default arguments. For example : - - def foo(arg1,arg2,*args): - proxyc.foo(arg1,arg2,args) - - This fails because args is now a tuple and SWIG doesn't know what to - do with it. - - This file allows a different approach : - - def foo(arg1,arg2,*args): - proxyc.__call_defarg(proxyc.foo,(arg1,arg2,)+args) - - Basically, we form a new tuple from the object, call this special - __call_defarg method and it passes control to the real wrapper function. - An ugly hack, but it works. -*/ - -SWIGINTERN PyObject *swig_call_defargs(PyObject *self, PyObject *args) { - PyObject *func; - PyObject *parms; - - if (!PyArg_ParseTuple(args, "OO", &func, &parms)) - return NULL; - - if (!PyCallable_Check(func)) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetString(PyExc_TypeError, "__call_defarg : Need a callable object!"); - SWIG_PYTHON_THREAD_END_BLOCK; - return NULL; - } - return PyObject_Call(func, parms, NULL); -} -- cgit v1.2.1