From 39599f2112004dc1aff1df8d1ff15ededbecdb4c Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Thu, 21 Mar 2019 21:17:21 +0000 Subject: Always use fastunpack for Python swigconstant wrappers --- Source/Modules/python.cxx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'Source') diff --git a/Source/Modules/python.cxx b/Source/Modules/python.cxx index 9eb233e9e..b8493352c 100755 --- a/Source/Modules/python.cxx +++ b/Source/Modules/python.cxx @@ -3592,11 +3592,7 @@ public: Printf(f_wrappers, "SWIGINTERN PyObject *%s_swigconstant(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {\n", iname); Printf(f_wrappers, tab2 "PyObject *module;\n", tm); Printf(f_wrappers, tab2 "PyObject *d;\n"); - if (fastunpack) { - Printf(f_wrappers, tab2 "if (!SWIG_Python_UnpackTuple(args, \"swigconstant\", 1, 1, &module)) return NULL;\n"); - } else { - Printf(f_wrappers, tab2 "if (!PyArg_UnpackTuple(args, \"swigconstant\", 1, 1, &module)) return NULL;\n"); - } + Printf(f_wrappers, tab2 "if (!SWIG_Python_UnpackTuple(args, \"swigconstant\", 1, 1, &module)) return NULL;\n"); Printf(f_wrappers, tab2 "d = PyModule_GetDict(module);\n"); Printf(f_wrappers, tab2 "if (!d) return NULL;\n"); Printf(f_wrappers, tab2 "%s\n", tm); @@ -3605,7 +3601,7 @@ public: // Register the method in SwigMethods array String *cname = NewStringf("%s_swigconstant", iname); - add_method(cname, cname, 0); + add_method(cname, cname, 0, 0, 1, 1, 1); Delete(cname); } else { Printf(f_init, "%s\n", tm); -- cgit v1.2.1