diff mbox series

[U-Boot,v2,09/17] rkmux: Convert to Python 3

Message ID 20191031134310.3072-9-sjg@chromium.org
State Accepted
Commit 5effab0549da404e0f2c21a3f7585aa643f54fc8
Headers show
Series scripts: Convert to Python 3 | expand

Commit Message

Simon Glass Oct. 31, 2019, 1:42 p.m. UTC
Convert this tool to Python 3 and make it use that, to meet the 2020
deadline.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v2: None

 tools/rkmux.py | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Comments

Simon Glass Nov. 5, 2019, 12:06 p.m. UTC | #1
Convert this tool to Python 3 and make it use that, to meet the 2020
deadline.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v2: None

 tools/rkmux.py | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Applied to u-boot-fdt
diff mbox series

Patch

diff --git a/tools/rkmux.py b/tools/rkmux.py
index 11c192a073..1226ee201c 100755
--- a/tools/rkmux.py
+++ b/tools/rkmux.py
@@ -1,4 +1,4 @@ 
-#!/usr/bin/env python2
+#!/usr/bin/env python3
 
 # Script to create enums from datasheet register tables
 #
@@ -43,8 +43,8 @@  class RegField:
         self.desc.append(desc)
 
     def Show(self):
-        print self
-        print
+        print(self)
+        print()
         self.__init__()
 
     def __str__(self):
@@ -65,11 +65,11 @@  class Printer:
             self.output_footer()
 
     def output_header(self):
-        print '/* %s */' % self.name
-        print 'enum {'
+        print('/* %s */' % self.name)
+        print('enum {')
 
     def output_footer(self):
-        print '};';
+        print('};');
 
     def output_regfield(self, regfield):
         lines = regfield.desc
@@ -97,7 +97,7 @@  class Printer:
             self.first = False
             self.output_header()
         else:
-            print
+            print()
         out_enum(field, 'shift', bit_low)
         out_enum(field, 'mask', mask)
         next_val = -1
@@ -175,7 +175,7 @@  def out_enum(field, suffix, value, skip_val=False):
             val_str = '%d' % value
 
         str += '%s= %s' % ('\t' * tabs, val_str)
-    print '\t%s,' % str
+    print('\t%s,' % str)
 
 # Process a CSV file, e.g. from tabula
 def process_csv(name, fd):