SWIG and Python: Create a package compatible with any 3.x version

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

SWIG and Python: Create a package compatible with any 3.x version



SWIG generates two wrapping layers for Python module: the C wrapper code and Python wrapper code. And, as I understand, both are agnostic to the specific subversion of Python 3.x (3.1-3.6 currently).

However, when compiling the code, I have to include the headers of specific 3.x version of Python, which includes the specific library version in PyConfig.h, e.g. 3.4: pragma comment(lib,"python34.lib") - which results in the Python package that has to find and load python34.dll in the runtime, and the loading will fail with any other version.

But all 3.x versions are compatible and simple editing of the produced .pyd binary - replacing the python34.dll with say python36.dll makes the final module to work with Python 3.6 just fine.

Is there any way to create a Python 3.x package with SWIG that would be able to search and find any available 3.x version installed on the system?



Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Swig-user mailing list
[hidden email]