I hope these changes are a short term interim solution for the
absence of the 'six' module/library. I also hope that soon this
module can be removed and be replaced by usage of six.
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
PY3 = sys.version_info[0] == 3
if PY3:
+ # compat functions
+ from urllib.parse import quote as urllib_quote
+ from urllib.request import urlopen as urllib_urlopen
+
+ # compat types
integer_types = int,
+ string_types = str
text_type = str
else:
+ # compat functions
+ from urllib import quote as urllib_quote
+ from urllib import urlopen as urllib_urlopen
+
+ # compat types
integer_types = (int, long)
+ string_types = basestring
text_type = unicode