diff --git a/shotgun_api3/lib/httplib2/python3/__init__.py b/shotgun_api3/lib/httplib2/python3/__init__.py index 3c61aac8a..9a9f9e55a 100644 --- a/shotgun_api3/lib/httplib2/python3/__init__.py +++ b/shotgun_api3/lib/httplib2/python3/__init__.py @@ -1,6 +1,10 @@ # -*- coding: utf-8 -*- """Small, fast HTTP client library for Python.""" +# TODO: remove __future__ import when support for py2 is completely dropped +# Needed until then to avoid py2 packaging barking on things of the form: print(..., end=...) +from __future__ import print_function + __author__ = "Joe Gregorio (joe@bitworking.org)" __copyright__ = "Copyright 2006, Joe Gregorio" __contributors__ = [ diff --git a/shotgun_api3/lib/httplib2/python3/socks.py b/shotgun_api3/lib/httplib2/python3/socks.py index cc68e634c..26bfc5de0 100644 --- a/shotgun_api3/lib/httplib2/python3/socks.py +++ b/shotgun_api3/lib/httplib2/python3/socks.py @@ -434,7 +434,7 @@ def __negotiatehttp(self, destaddr, destport): wrote_host_header = False wrote_auth_header = False if self.__proxy[6] != None: - for key, val in self.__proxy[6].iteritems(): + for key, val in self.__proxy[6].items(): headers += [key, ": ", val, "\r\n"] wrote_host_header = key.lower() == "host" wrote_auth_header = key.lower() == "proxy-authorization" diff --git a/shotgun_api3/lib/mimetypes.py b/shotgun_api3/lib/mimetypes.py index bc8488535..cbd3fe875 100644 --- a/shotgun_api3/lib/mimetypes.py +++ b/shotgun_api3/lib/mimetypes.py @@ -568,14 +568,14 @@ def _default_mime_types(): """ def usage(code, msg=''): - print USAGE - if msg: print msg + print(USAGE) + if msg: print(msg) sys.exit(code) try: opts, args = getopt.getopt(sys.argv[1:], 'hle', ['help', 'lenient', 'extension']) - except getopt.error, msg: + except getopt.error as msg: usage(1, msg) strict = 1 @@ -590,9 +590,9 @@ def usage(code, msg=''): for gtype in args: if extension: guess = guess_extension(gtype, strict) - if not guess: print "I don't know anything about type", gtype - else: print guess + if not guess: print("I don't know anything about type %s" % gtype) + else: print(guess) else: guess, encoding = guess_type(gtype, strict) - if not guess: print "I don't know anything about type", gtype - else: print 'type:', guess, 'encoding:', encoding \ No newline at end of file + if not guess: print("I don't know anything about type %s" % gtype) + else: print('type: %s encoding: %s' % (guess, encoding))