diff --git a/SWIG/Source/Modules/python.cxx b/SWIG/Source/Modules/python.cxx index 882ca1f78..07fb608ce 100644 --- a/SWIG/Source/Modules/python.cxx +++ b/SWIG/Source/Modules/python.cxx @@ -986,8 +986,7 @@ public: Printf(f_shadow_stubs,"%s = %s.%s\n", global_name, module, global_name); } } - - if ((shadow) && (SwigType_isconst(t))) { + if ((shadow) && (!SwigType_ismutable(t))) { if (!in_class) { Printf(f_shadow_stubs,"%s = %s.%s\n", iname, global_name, iname); } diff --git a/SWIG/Source/Swig/stype.c b/SWIG/Source/Swig/stype.c index f7d9ac33c..59ab6f412 100644 --- a/SWIG/Source/Swig/stype.c +++ b/SWIG/Source/Swig/stype.c @@ -227,7 +227,7 @@ int SwigType_isconst(SwigType *t) { int SwigType_ismutable(SwigType *t) { int r; SwigType *qt = SwigType_typedef_resolve_all(t); - if (SwigType_isreference(qt)) { + if (SwigType_isreference(qt) || SwigType_isarray(qt)) { Delete(SwigType_pop(qt)); } r = SwigType_isconst(qt);