2013-01-03 14:12:27 +01:00
|
|
|
"""
|
|
|
|
Python 2/3 compatibility.
|
|
|
|
|
|
|
|
"""
|
|
|
|
#noinspection PyUnresolvedReferences
|
|
|
|
from requests.compat import (
|
|
|
|
is_windows,
|
|
|
|
bytes,
|
|
|
|
str,
|
|
|
|
is_py3,
|
|
|
|
is_py26,
|
|
|
|
)
|
|
|
|
|
|
|
|
try:
|
2013-08-18 00:59:10 +02:00
|
|
|
#noinspection PyUnresolvedReferences,PyCompatibility
|
2013-01-03 14:12:27 +01:00
|
|
|
from urllib.parse import urlsplit
|
|
|
|
except ImportError:
|
2013-08-18 00:59:10 +02:00
|
|
|
#noinspection PyUnresolvedReferences,PyCompatibility
|
2013-01-03 14:12:27 +01:00
|
|
|
from urlparse import urlsplit
|
2014-04-24 14:07:31 +02:00
|
|
|
|
|
|
|
try:
|
|
|
|
#noinspection PyCompatibility
|
|
|
|
from urllib.request import urlopen
|
|
|
|
except ImportError:
|
|
|
|
#noinspection PyCompatibility
|
|
|
|
from urllib2 import urlopen
|