diff --git a/SWIG/Source/Modules/python.cxx b/SWIG/Source/Modules/python.cxx index 85910d9a6..7ae9b9925 100644 --- a/SWIG/Source/Modules/python.cxx +++ b/SWIG/Source/Modules/python.cxx @@ -2041,7 +2041,7 @@ public: String *type = Getattr(n, "type"); //Node *classNode = Swig_methodclass(n); //Node *module = Getattr(classNode, "module"); - Node *parent = Getattr(n,"parentNode"); + Node *parent = Swig_methodclass(n); Node *module = Getattr(parent, "module"); Node *target = Swig_directormap(module, type); if (target) unwrap = 1; diff --git a/SWIG/Source/Modules/ruby.cxx b/SWIG/Source/Modules/ruby.cxx index 5a99605bb..c1ef06e35 100644 --- a/SWIG/Source/Modules/ruby.cxx +++ b/SWIG/Source/Modules/ruby.cxx @@ -1235,7 +1235,7 @@ public: int is_reference = SwigType_isreference_return(decl); if (is_pointer || is_reference) { String *type = Getattr(n, "type"); - Node *parent = Getattr(n,"parentNode"); + Node *parent = Swig_methodclass(n); Node *modname = Getattr(parent, "module"); Node *target = Swig_directormap(modname, type); if (target) unwrap = true;