Fix compilation with python 3.7 - #80
Merged
Merged
Conversation
_PyImport_FixupExtensionObject now takes four arguments. The libpython library is now 2-digit versioned (at least on Debian), so use -lpython3.7 not -lpython3 at link time. The StringField class subclasses bytes, which needs a str() as its initialiser. Py_GetPath() and Py_GetProgramFullPath() return wide-char strings, so use %ls when printing.
Contributor
Author
|
This addresses issue #79 |
Owner
|
Thank you! Just a quick question on this - should it work for Python 3 versions older than 3.7? |
Contributor
Author
|
Probably not. _PyImport_FixupExtensionObject() now takes four arguments; it used to take three. Python 3.6 or earlier use the 3-argument form. The other changes should be benign. |
Contributor
Author
|
I can add a guard around that if you like (but I don't really like #ifdefs in code.) |
Owner
|
I think adding some ifdefs is the only way to go here so as to not break it for people with older Python. |
added 2 commits
November 7, 2019 09:32
Python provides a way to query the library name to link against, so use it. This allows for distributions that name their libraries with various suffices (like libpython3.5m.so) where it's not just the version that's important.
I've now tested with pytohon 2.7, 3.6, and 3.7, and all three build.
Contributor
Author
|
I think the two changes I've just pushed will fix this. The code builds cleanly against 2.7, 3,5 and 3.7; and I've tested 3.7. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
_PyImport_FixupExtensionObject now takes four arguments.
The libpython library is now 2-digit versioned (at least on Debian), so
use -lpython3.7 not -lpython3 at link time.
The StringField class subclasses bytes, which needs a str() as its
initialiser.
Py_GetPath() and Py_GetProgramFullPath() return wide-char strings,
so use %ls when printing.