convert to print function

Newer repo's sometimes import the print function on us, and then import
these python files directly which then throws an error.  Convert us to
the print function to avoid it.  It's not a bad thing.

BUG=None
TEST=`./pre-upload_unittest.py` passes

Change-Id: Idb8ab16d764157020482611df27e17d92dd280ae
Reviewed-on: https://chromium-review.googlesource.com/194399
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
diff --git a/errors.py b/errors.py
index 198d0e2..398223a 100644
--- a/errors.py
+++ b/errors.py
@@ -2,6 +2,8 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
+from __future__ import print_function
+
 import re
 import sys
 
@@ -30,7 +32,7 @@
   """
   regex = re.compile(r'^', re.M)
   msg = regex.sub(_INDENT * indent_level, msg)
-  print >> sys.stderr, msg
+  print(msg, file=sys.stderr)
 
 
 def _FormatCommitDesc(desc):
@@ -57,7 +59,7 @@
   """
   _PrintWithIndent(_PROJECT_INFO % project, 0)
   _PrintWithIndent(_FormatHookFailure(error), 1)
-  print >> sys.stderr, ''
+  print('', file=sys.stderr)
 
 
 def PrintErrorsForCommit(project, commit, commit_desc, error_list):
@@ -98,5 +100,4 @@
   for error in error_list:
     _PrintWithIndent(_FormatHookFailure(error), 3)
 
-  print >> sys.stderr, ''
-
+  print('', file=sys.stderr)
diff --git a/pre-upload.py b/pre-upload.py
index 77ea6fe..dda8968 100644
--- a/pre-upload.py
+++ b/pre-upload.py
@@ -2,6 +2,8 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
+from __future__ import print_function
+
 import ConfigParser
 import json
 import os
@@ -382,7 +384,7 @@
       if not config.getboolean(SECTION, flag): disable_flags.append(flag)
     except ValueError as e:
       msg = "Error parsing flag \'%s\' in %s file - " % (flag, _CONFIG_FILE)
-      print msg + str(e)
+      print(msg + str(e))
 
   disabled_keys = set(_DISABLE_FLAGS.iterkeys()).intersection(disable_flags)
   return set([_DISABLE_FLAGS[key] for key in disabled_keys])
@@ -454,7 +456,7 @@
            '- To disable some source style checks, and for other hints, see '
            '<checkout_dir>/src/repohooks/README\n'
            '- To upload only current project, run \'repo upload .\'')
-    print >> sys.stderr, msg
+    print(msg, file=sys.stderr)
     sys.exit(1)