Skip to content

Update the package to Python 3 #12

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

Open
HGStyle opened this issue Jan 18, 2023 · 0 comments
Open

Update the package to Python 3 #12

HGStyle opened this issue Jan 18, 2023 · 0 comments

Comments

@HGStyle
Copy link

HGStyle commented Jan 18, 2023

You literaly just need to replace only one line !
This line:

import urllib2

Need to be replaced by this line:

import urllib.request as urllib2

If you want that Python2 and Python3 are supported, replace the import urllib2 line by:

import sys
if int(sys.version_info[0]) > 2:
    import urllib.request as urllib2
else:
    import urllib2

Please, change this in the code, then republish the package on PyPI.
Thanks !

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

2 participants
@HGStyle and others