From 91ea054303ea1a6eca8d2f874e8dc805e36b94ce Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Wed, 21 Jan 2004 01:33:07 +0000 Subject: [PATCH] fix the generation of spurious temps, and an exception call git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5660 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Source/Modules/python.cxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/SWIG/Source/Modules/python.cxx b/SWIG/Source/Modules/python.cxx index 055c055d8..ed36b9c48 100644 --- a/SWIG/Source/Modules/python.cxx +++ b/SWIG/Source/Modules/python.cxx @@ -733,8 +733,10 @@ public: Wrapper_add_local(f, "director", "Swig::Director *director = 0"); Printf(f->code, "director = dynamic_cast(arg1);\n"); if (dirprot_mode() && is_protected(n)) { - Printf(f->code, "if (!director || !(director->swig_get_inner(\"%s\"))) ", name); - Printf(f->code, "SWIG_exception(SWIG_RuntimeError,\"accessing protected member %s\");\n", name); + Printf(f->code, "if (!director || !(director->swig_get_inner(\"%s\"))) {\n", name); + Printf(f->code, "PyErr_SetString(PyExc_RuntimeError,\"accessing protected member %s\");\n", name); + Printf(f->code, "SWIG_fail;\n"); + Printf(f->code, "}\n"); } Printf(f->code, "if (director && (director->swig_get_self()==obj0)) director->swig_set_up();\n"); } @@ -1179,10 +1181,10 @@ public: String *arglist = NewString(""); String* parse_args = NewString(""); - /* 'in' parameters don't use a wrap, they are used directly */ + /* remove the wrapper 'w' since it was producing spurious temps */ Swig_typemap_attach_parms("in", l, 0); - Swig_typemap_attach_parms("directorin", l, w); - Swig_typemap_attach_parms("directorout", l, w); + Swig_typemap_attach_parms("directorin", l, 0); + Swig_typemap_attach_parms("directorout", l, 0); Swig_typemap_attach_parms("directorargout", l, w); Parm* p;