[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[Patch] Support building with SWIG 4 on Python 3.x

From: Jun Omae <jun66j5_at_gmail.com>
Date: Wed, 13 Nov 2019 22:22:49 +0900


I tried to support building SWIG 4 on Python 3.x, and post patch.

Since SWIG 4, -classic and -modern options have been dropped. As the result,
SWIG generates new-style classes which are using property() instead of

In attached patch, SWIG would generate new-style classes without
__swig_[gs]etmethods__ when SWIG 3.x is used (-modern option would be used),
in the same as SWIG 4.x.

Verified by check-swig-py with:

  - Python 3.[5678] with SWIG 1.3.40, 2.0.12, 3.0.12 on Ubuntu 16.04 amd64
  - Python 2.7 with SWIG 3.0.12 and 4.0.1 on Ubuntu 16.04 amd64

Support building SWIG 4 on Python 3.x.

* build/ac-macros/swig.m4 (SVN_FIND_SWIG):
   Allow building with SWIG 4+, and add -modern option when Python 3 and
   SWIG 3.x are detected.

* subversion/bindings/swig/include/proxy.py
   Use _get_instance_attr and _set_instance_attr.

* subversion/bindings/swig/include/proxy.swg
   (_get_instance_attr): New function to get an instance attribute
   without metadata for new-style and old-style classes.
   (_set_instance_attr): New function to set an instance attribute for
   new-style and old-style classes.


Jun Omae <jun66j5_at_gmail.com> ($BBgA0(B $B=a(B)

Received on 2019-11-13 14:22:56 CET

This is an archived mail posted to the Subversion Dev mailing list.