Closed twistor closed 7 years ago
omg, but than python3 support will be broken?
No, this doesn't change the behavior for Python 3. The only difference is that the imports have changed from 2 to 3. So, we try to import from Python 3, and if that fails, try to import from Python 2.
try:
from urllib.parse import urlencode
from urllib.request import urlopen
from urllib.request import Request
from urllib.request import URLError
except ImportError:
from urllib import urlencode
from urllib2 import urlopen
from urllib2 import Request
from urllib2 import URLError
oh, I see, thx!
Trying to use this on Fedora 25 and having problems because it's using python 2.