Alternate fix for bug #1578346 (the previous one broke Python properties in modern classes)

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9560 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Luigi Ballabio 2006-11-15 17:26:25 +00:00
commit 31d299384e
2 changed files with 1305 additions and 1304 deletions

View file

@ -2610,9 +2610,10 @@ public:
if (str != NULL && Len(str)) if (str != NULL && Len(str))
Printv(f_shadow, tab4, str, "\n", NIL); Printv(f_shadow, tab4, str, "\n", NIL);
} }
if (!modern) {
Printv(f_shadow, tab4, "__swig_setmethods__ = {}\n", NIL); Printv(f_shadow, tab4, "__swig_setmethods__ = {}\n", NIL);
if (Len(base_class)) { if (Len(base_class)) {
Printf(f_shadow, "%sfor _s in [%s]: __swig_setmethods__.update(_s.__swig_setmethods__)\n", tab4, base_class); Printf(f_shadow, "%sfor _s in [%s]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))\n", tab4, base_class);
} }
if (!GetFlag(n, "feature:python:nondynamic")) { if (!GetFlag(n, "feature:python:nondynamic")) {
@ -2623,11 +2624,11 @@ public:
Printv(f_shadow, tab4, "__swig_getmethods__ = {}\n", NIL); Printv(f_shadow, tab4, "__swig_getmethods__ = {}\n", NIL);
if (Len(base_class)) { if (Len(base_class)) {
Printf(f_shadow, "%sfor _s in [%s]: __swig_getmethods__.update(_s.__swig_getmethods__)\n", tab4, base_class); Printf(f_shadow, "%sfor _s in [%s]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))\n", tab4, base_class);
} }
Printv(f_shadow, tab4, "__getattr__ = lambda self, name: _swig_getattr(self, ", class_name, ", name)\n", NIL); Printv(f_shadow, tab4, "__getattr__ = lambda self, name: _swig_getattr(self, ", class_name, ", name)\n", NIL);
if (modern) { } else {
Printv(f_shadow, tab4, "thisown = _swig_property(lambda x: x.this.own(), ", "lambda x, v: x.this.own(v), doc='The membership flag')\n", NIL); Printv(f_shadow, tab4, "thisown = _swig_property(lambda x: x.this.own(), ", "lambda x, v: x.this.own(v), doc='The membership flag')\n", NIL);
/* Add static attribute */ /* Add static attribute */
if (GetFlag(n, "feature:python:nondynamic")) { if (GetFlag(n, "feature:python:nondynamic")) {

View file

@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script.
dnl The macros which aren't shipped with the autotools are stored in the dnl The macros which aren't shipped with the autotools are stored in the
dnl Tools/config directory in .m4 files. dnl Tools/config directory in .m4 files.
AC_INIT([swig],[1.3.30],[http://www.swig.org]) AC_INIT([swig],[1.3.31],[http://www.swig.org])
AC_PREREQ(2.58) AC_PREREQ(2.58)
AC_CONFIG_SRCDIR([Source/Swig/swig.h]) AC_CONFIG_SRCDIR([Source/Swig/swig.h])
AC_CONFIG_AUX_DIR([Tools/config]) AC_CONFIG_AUX_DIR([Tools/config])