On 29.09.2019 23:32, Johan Corveleyn wrote:
> BTW, I have one more question: is it expected that "swig-python
> bindings compiled with python 3" cannot be used by python 2? Because
> if I run the testsuite with Python 2.7.16, after I have compiled them
> with Python 3.7.4, I get the following error:
> C:\research\svn\dev\swig-py3>python --version
> Python 2.7.16
> C:\research\svn\dev\swig-py3>runtest.bat --swig=python
> Testing Release configuration on local repository.
> -- Running Swig Python tests --
> Traceback (most recent call last):
> File "C:\research\svn\dev\swig-py3\subversion\bindings\swig\python\tests\run_all.py",
> line 23, in <module>
> import mergeinfo, core, client, delta, checksum, pool, fs, ra, wc,
> repository, \
> File "C:\research\svn\dev\swig-py3\subversion\bindings\swig\python\tests\mergeinfo.py",
> line 22, in <module>
> from svn import core, repos, fs
> File "C:\research\svn\dev\swig-py3\subversion\bindings\swig\python\tests/..\svn\core.py",
> line 26, in <module>
> from libsvn.core import *
> File "R:\test_release--swigpython\swig\pylib\libsvn\core.py", line 137
> def apr_initialize() -> "apr_status_t":
> SyntaxError: invalid syntax
> [Test runner reported failure]
> So distributors / packagers that want to support both py2 and py3
> users, will have to create two sets of bindings.
Yes, they will. Python 2 and 3 libraries have to be separate anyway, and
the native bits of our bindings use different runtime libs.
Interesting and also very nice that Swig uses PEP 484 type annotations.
The Python 2 parser doesn't recognise those.
Received on 2019-09-30 01:33:22 CEST