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

Convert to Python3 #144

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Convert to Python3 #144

wants to merge 7 commits into from

Conversation

ralic
Copy link

@ralic ralic commented May 21, 2017

No description provided.

@@ -20,7 +20,7 @@
$Id$
"""

import os, shutil, sys, tempfile, urllib2
import os, shutil, sys, tempfile, urllib.request, urllib.error, urllib.parse

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thats python3 only

Copy link
Author

@ralic ralic May 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add following script shall make it python2/3 compatible

# Python 2 and 3: alternative 4
try:
    from urllib.parse import urlparse, urlencode
    from urllib.request import urlopen, Request
    from urllib.error import HTTPError
except ImportError:
    from urlparse import urlparse
    from urllib import urlencode
    from urllib2 import urlopen, Request, HTTPError

@RonnyPfannschmidt
Copy link

btw, did you communicate with the maintainer before undertaking this massive conversation?

@benoitc
Copy link
Owner

benoitc commented May 28, 2017 via email

@benoitc
Copy link
Owner

benoitc commented Sep 19, 2019

i think i'm fine with the pr, maybe some extensions can be removed?

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.

None yet

3 participants