Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make py3 compatible #94

Open
davidlmobley opened this issue Jan 12, 2017 · 4 comments
Open

Make py3 compatible #94

davidlmobley opened this issue Jan 12, 2017 · 4 comments

Comments

@davidlmobley
Copy link
Member

Needs to be made py3 compatible

@nathanmlim
Copy link
Collaborator

I've had a converted py3 version by using anaconda's 2to3 conversion tool. There were some hiccups during conversion involving bytes/strings but I think I've handled them. Also, I've only tested this for the gromacs parser and have not tested for python2 backwards compatibility.

Just pushed the branch now

@davidlmobley
Copy link
Member Author

Thanks, @Limn1 . That works for me under python3.5 but not python2.7; it seems to be using some python3-specific features of the print function. It should, however, be possible to modify it so it can work under both. I'll have to revisit this to achieve that.

@davidlmobley
Copy link
Member Author

davidlmobley commented Jan 13, 2017

e.g. print() can be python2 compatible, but I'm getting this error:

print(str1, end=' ')
                   ^
SyntaxError: invalid syntax

around line 753

@halx
Copy link
Collaborator

halx commented Jan 14, 2017

For compatibility with Python3 the very first import in Python 2.7 should be

from __future__ import print_function

which is ignored in Python3.

I suggest though to replace all prints with logger functions. But I guess this can be delayed until we start writing the new version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants