1 From 8ff4cfd06ce554e9df31a088c9d09f45278c6de4 Mon Sep 17 00:00:00 2001
2 From: Yasuhito Futatsuki <futatuki@apache.org>
3 Date: Tue, 20 Sep 2022 12:57:06 +0000
4 Subject: [PATCH] swig-py: Fix conditionals by SWIG version and by Python
5 version for proxy code.
7 We are using different code for proxy object, by Python version and by SWIG
8 version. The distinguish between Python 2 and Python 3 was done by SWIG
9 macro "SWIGPYTHON_PY3". However, the macro was dropped since SWIG commit
10 a343b7e[1], between SWIG 4.0.2 release and upcoming SWIG 4.1.0 release.
12 As we already dropped support for the combination of SWIG >= 4.0 and Python 2,
13 we should detect Python 2 only in SWIG < 4.0 case. So we can rely on the macro
16 * subversion/bindings/swig/include/proxy.swg ():
17 Reorder the conditionals distinguish SWIG versions and Python versions,
20 Found by: Jitka Plesnikova (jplesnik {_AT_} redhat.com)
22 Suggested by: Julien Schueller (schueller {_AT_} phimeca.com) [2]
24 [1] https://github.com/swig/swig/commit/a343b7e254567a64761bc1be7dc55b7b7424ec52
25 [2] https://github.com/swig/swig/issues/2373#issuecomment-1250997124
28 git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1904167 13f79535-47bb-0310-9956-ffa450edef68
30 subversion/bindings/swig/include/proxy.swg | 4 +---
31 1 file changed, 1 insertion(+), 3 deletions(-)
33 diff --git a/subversion/bindings/swig/include/proxy.swg b/subversion/bindings/swig/include/proxy.swg
34 index ac67d434ca..7d2d0dd033 100644
35 --- a/subversion/bindings/swig/include/proxy.swg
36 +++ b/subversion/bindings/swig/include/proxy.swg
41 -#if defined(SWIGPYTHON_PY3)
42 #if SWIG_VERSION >= 0x040000
44 # -classic and -modern options have been dropped and this variable
46 _set_instance_attr = _swig_setattr_nondynamic_instance_variable(object.__setattr__)
50 +#elif defined(SWIGPYTHON_PY3)
52 # SWIG classes generated with -modern do not define this variable
55 _set_instance_attr = _swig_setattr_nondynamic_method(object.__setattr__)
61 # SWIG classes generated with -classic do not define this variable,