diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2022-03-23 07:51:30 +0000 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2022-03-23 07:58:39 +0000 |
commit | df86fbc54ec707443a6e52f6e887fc909244472f (patch) | |
tree | 665f14004631c1eac0fe4f16d55cb4546784a3ce /Source/Modules/python.cxx | |
parent | f068f2c2d6d2d8f8a3c101f34fc290d3b822653e (diff) | |
download | swig-df86fbc54ec707443a6e52f6e887fc909244472f.tar.gz |
Remove option to use Python 3 only syntax for %pythonnondynamic feature
A metaclass is added using a decorator @_swig_add_metaclass which
is designed to provide a metaclass that works for both Python 2 and Python 3.
The option to use the Python 3 only syntax: metaclass=_SwigNonDynamicMeta
via the -py3 command line option has been removed as part of a
simplification to remove the -py3 option.
Issue #1779
Diffstat (limited to 'Source/Modules/python.cxx')
-rw-r--r-- | Source/Modules/python.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/Modules/python.cxx b/Source/Modules/python.cxx index 83c00929c..41569cb18 100644 --- a/Source/Modules/python.cxx +++ b/Source/Modules/python.cxx @@ -4498,10 +4498,8 @@ public: Delete(rname); } } else { - if (!py3) { - if (GetFlag(n, "feature:python:nondynamic")) - Printv(f_shadow, "@_swig_add_metaclass(_SwigNonDynamicMeta)\n", NIL); - } + if (GetFlag(n, "feature:python:nondynamic")) + Printv(f_shadow, "@_swig_add_metaclass(_SwigNonDynamicMeta)\n", NIL); Printv(f_shadow, "class ", class_name, NIL); if (Len(base_class)) { @@ -4511,9 +4509,11 @@ public: Printf(f_shadow, "(Exception)"); } else { Printf(f_shadow, "(object"); - if (py3 && GetFlag(n, "feature:python:nondynamic")) { + /* Replace @_swig_add_metaclass above with below when support for python 2.7 is dropped + if (GetFlag(n, "feature:python:nondynamic")) { Printf(f_shadow, ", metaclass=_SwigNonDynamicMeta"); } + */ Printf(f_shadow, ")"); } } |