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

Refactored for native python3 support (maintain python2 support with version detection) #67

Merged
merged 3 commits into from
May 7, 2020

Conversation

AMDHome
Copy link
Contributor

@AMDHome AMDHome commented Feb 20, 2020

The same script can now be run on Python 2 and Python 3

Main issues between Python 2.x and Python 3.x on this script are the handling of bytes/strings and the print statements.

Changes made:

  • Changed print statements to use the print() function that both versions support
  • Added another set of encrypt/decrypt functions that are chosen using version detection.

There are no changes to the functionality of the script. You can run it with exactly the same arguments as you could before. Should be more or less a drop in replacement for everyone as long as the print statement formatting doesn't screw things up for you. It also allows for people to use this script with Python 3 in the future.

If you don't like the giant if statement you can choose which functions you want depending on the version you are using and delete the other one in your own projects. First set of encode/decode is for python3 the second set is for python 2

@softScheck
Copy link
Owner

Thanks for your commit. Looks good.

@softScheck softScheck merged commit 1f85d61 into softScheck:master May 7, 2020
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

Successfully merging this pull request may close these issues.

2 participants