[Python] Fix regression in indentation of python code produced with -modern,

introduced by changes in #188.  Reported by fabiencastan in #218.
This commit is contained in:
Olly Betts 2014-09-02 02:34:01 -03:00
commit f3a6c55929
2 changed files with 17 additions and 10 deletions

View file

@ -5,6 +5,11 @@ See the RELEASENOTES file for a summary of changes in each release.
Version 3.0.3 (in progress) Version 3.0.3 (in progress)
=========================== ===========================
2014-09-02: olly
[Python] Fix regression in indentation of python code produced with
-modern, introduced by changes in #188. Reported by fabiencastan
in #218.
2014-09-01: olly 2014-09-01: olly
Issue an error for unknown SWIG preprocessor directives, rather Issue an error for unknown SWIG preprocessor directives, rather
than quietly ignoring them. Reported by jrhelsey in issue#217. than quietly ignoring them. Reported by jrhelsey in issue#217.

View file

@ -4572,11 +4572,12 @@ public:
Printv(f_shadow, tab4, "__swig_getmethods__[\"", symname, "\"] = ", module, ".", getname, "\n", NIL); Printv(f_shadow, tab4, "__swig_getmethods__[\"", symname, "\"] = ", module, ".", getname, "\n", NIL);
} }
if (!classic) { if (!classic) {
if (!assignable) { if (!modern)
Printv(f_shadow, tab4, modern ? "" : "if _newclass:\n", tab8, symname, " = _swig_property(", module, ".", getname, ")\n", NIL); Printv(f_shadow, tab4, "if _newclass:\n", tab4, NIL);
} else { Printv(f_shadow, tab4, symname, " = _swig_property(", module, ".", getname, NIL);
Printv(f_shadow, tab4, modern ? "" : "if _newclass:\n", tab8, symname, " = _swig_property(", module, ".", getname, ", ", module, ".", setname, ")\n", NIL); if (assignable)
} Printv(f_shadow, ", ", module, ".", setname, NIL);
Printv(f_shadow, ")\n", NIL);
} }
Delete(mname); Delete(mname);
Delete(setname); Delete(setname);
@ -4645,11 +4646,12 @@ public:
Printv(f_shadow, tab4, "__swig_getmethods__[\"", symname, "\"] = ", module, ".", getname, "\n", NIL); Printv(f_shadow, tab4, "__swig_getmethods__[\"", symname, "\"] = ", module, ".", getname, "\n", NIL);
} }
if (!classic && !builtin) { if (!classic && !builtin) {
if (!assignable) { if (!modern)
Printv(f_shadow, tab4, modern ? "" : "if _newclass:\n", tab8, symname, " = _swig_property(", module, ".", getname, ")\n", NIL); Printv(f_shadow, tab4, "if _newclass:\n", tab4, NIL);
} else { Printv(f_shadow, tab4, symname, " = _swig_property(", module, ".", getname, NIL);
Printv(f_shadow, tab4, modern ? "" : "if _newclass:\n", tab8, symname, " = _swig_property(", module, ".", getname, ", ", module, ".", setname, ")\n", NIL); if (assignable)
} Printv(f_shadow, ", ", module, ".", setname, NIL);
Printv(f_shadow, ")\n", NIL);
} }
String *getter = Getattr(n, "pybuiltin:getter"); String *getter = Getattr(n, "pybuiltin:getter");
String *setter = Getattr(n, "pybuiltin:setter"); String *setter = Getattr(n, "pybuiltin:setter");