+try:
+ from urllib.error import HTTPError, URLError
+ from urllib.parse import parse_qsl, urlencode, urlparse, urlsplit, urlunsplit
+ from urllib.request import urlopen
+except ImportError:
+ from urllib import urlencode
+ from urllib2 import HTTPError, URLError, urlopen
+ from urlparse import parse_qsl, urlparse, urlsplit, urlunsplit