From 2f9749cb041dcef91975745151da2ced356eeee5 Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Wed, 28 Jan 2004 01:47:19 +0000 Subject: [PATCH] cosmetic fix to avoid warnings in the generated code git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5694 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Source/Modules/python.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SWIG/Source/Modules/python.cxx b/SWIG/Source/Modules/python.cxx index a7eb06258..6c87d2bd3 100644 --- a/SWIG/Source/Modules/python.cxx +++ b/SWIG/Source/Modules/python.cxx @@ -508,7 +508,6 @@ public: int varargs = 0; int allow_kwargs = check_kwargs(n); - /* member of a director class? */ String *nodeType = Getattr(n, "nodeType"); int constructor = (!Cmp(nodeType, "constructor")); int destructor = (!Cmp(nodeType, "destructor")); @@ -974,8 +973,8 @@ public: /* Create a function for setting the value of the variable */ - Printf(setf->def,"static int %s_set(PyObject *_val) {", wname); if (!Getattr(n,"feature:immutable")) { + Printf(setf->def,"static int %s_set(PyObject *_val) {", wname); if ((tm = Swig_typemap_lookup_new("varin",n,name,0))) { Replaceall(tm,"$source","_val"); Replaceall(tm,"$target",name); @@ -989,6 +988,7 @@ public: Printf(setf->code," return 0;\n"); } else { /* Is a readonly variable. Issue an error */ + Printf(setf->def,"static int %s_set(PyObject *) {", wname); Printv(setf->code, tab4, "PyErr_SetString(PyExc_TypeError,\"Variable ", iname, " is read-only.\");\n",