From 6d714989160196f5698ade1164b0cac80ad30215 Mon Sep 17 00:00:00 2001 From: Wei-ju Wu Date: Tue, 20 Sep 2016 08:41:23 -0700 Subject: [PATCH] fdtool.py migrated to Python 3 --- utils/fdtool/fdtool.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/utils/fdtool/fdtool.py b/utils/fdtool/fdtool.py index 9d60ec2..c7c0bad 100755 --- a/utils/fdtool/fdtool.py +++ b/utils/fdtool/fdtool.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 """ fdtool.py - simple FD file processing tool. @@ -36,7 +36,7 @@ def process_command(command, state): elif command.startswith('end'): pass else: - print "unsupported command: ", command + print("unsupported command: ", command) def process_fundef(line, state): @@ -46,10 +46,9 @@ def process_fundef(line, state): name, params, regs = match.group(1, 2, 3) if state.public: if len(params) > 0: - print "-%d -> %s(%s), [%s]" % (state.offset, - name, params, regs) + print("-%d -> %s(%s), [%s]" % (state.offset, name, params, regs)) else: - print "-%d -> %s()" % (state.offset, name) + print("-%d -> %s()" % (state.offset, name)) state.offset += 6 @@ -64,7 +63,7 @@ def process(input_file): process_command(line[2:], state) else: process_fundef(line.strip(), state) - print "Done." + print("Done.") if __name__ == '__main__': description = """fdtool - stub generator for FD files (c) 2013"""