From 2d3c0ac6d409ed0b086e335010c77e1183ef60cb Mon Sep 17 00:00:00 2001 From: Dmitry Galkin Date: Tue, 19 Jun 2018 08:10:22 +0600 Subject: [PATCH] Fixed bin/img_rotate to work in both python2 and python3 --- bin/img_rotate | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/img_rotate b/bin/img_rotate index 97edb82..e8ffa81 100644 --- a/bin/img_rotate +++ b/bin/img_rotate @@ -1,10 +1,12 @@ #!/usr/bin/env python +from __future__ import print_function + import sys import img_rotate path = sys.argv[1] try: image, degrees = img_rotate.fix_orientation(path, save_over=True) - print '%s was rotated %s degrees.' % (path, degrees) -except Exception, e: - print "** Error: %s" % e + print('%s was rotated %s degrees.' % (path, degrees)) +except Exception as e: + print("** Error: %s" % e)