WIP: Python 3 compatibility, fix #888 #889
Open
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.
Hi again,
This PR follows enki-community/enki#61 & enki-community/enki#62 and fixes #888
As in enki-community/enki#62, to ensure that there is no syntax errors in python scripts neither in python2 nor 3, I used the flake8 linter with
python2 -m flake8
andpython3 -m flake8
.I also ran the full test suite with success with both python versions.
Most changes are:
if var == True:
intoif var:
if var {!,=}= None
intoif var is {not,} None
raw_input
andbasestring
isort and yapf have also been helping a bit, and they have made aesthetic choices you might not be comfortable with. If this is the case, I can obviously revert that to the previous format that you did prefer.
NB: u-strings have not been removed, therefore this will not work on python3 < 3.3, but most distributions provide >= 3.4.
PS: This is a Work In Progress, as there is no point in merging this PR before those that enable python3 build in enki