From d5826859e7bc0dee1f2f3604681d6130bcd5e5e6 Mon Sep 17 00:00:00 2001 From: uikokahonia Date: Tue, 31 May 2022 12:02:59 +0200 Subject: [PATCH] mimetypes.py: changing print statements from the old py2 'print' keyword syntax into the newer 'print' function syntax, also changing one try-except catching from the old 'comma' syntax to the newer 'as' keyword syntax --- shotgun_api3/lib/mimetypes.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/shotgun_api3/lib/mimetypes.py b/shotgun_api3/lib/mimetypes.py index bc8488535..19345719d 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"), 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"), gtype + else: print('type:', guess, 'encoding:', encoding) \ No newline at end of file