]> git.sur5r.net Git - u-boot/blobdiff - tools/patman/terminal.py
patman: Make print statements python 3.x safe
[u-boot] / tools / patman / terminal.py
index af3593eb34e795abaad3da4cafb025d937b1f9ae..137265fc81541ebb77726cce41e17c771fd9126d 100644 (file)
@@ -8,6 +8,8 @@
 This module handles terminal interaction including ANSI color codes.
 """
 
+from __future__ import print_function
+
 import os
 import sys
 
@@ -52,9 +54,9 @@ def Print(text='', newline=True, colour=None):
         if colour:
             col = Color()
             text = col.Color(colour, text)
-        print text,
+        print(text, end='')
         if newline:
-            print
+            print()
         else:
             sys.stdout.flush()
 
@@ -81,11 +83,11 @@ def EchoPrintTestLines():
     for line in print_test_list:
         if line.colour:
             col = Color()
-            print col.Color(line.colour, line.text),
+            print(col.Color(line.colour, line.text), end='')
         else:
-            print line.text,
+            print(line.text, end='')
         if line.newline:
-            print
+            print()
 
 
 class Color(object):