From eb2d582c2975e0d8e2c62031ebc1dadfcdce258f Mon Sep 17 00:00:00 2001 From: Tim Condon <0xTim@users.noreply.github.com> Date: Tue, 17 May 2022 11:46:02 +0200 Subject: [PATCH] Update Python script to Python 3 (#117) --- scripts/build-asm.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/build-asm.py b/scripts/build-asm.py index 549cd8f0..b1b7de0f 100755 --- a/scripts/build-asm.py +++ b/scripts/build-asm.py @@ -185,11 +185,11 @@ def munge_file(pp_arch, pp_platform, source_lines, sink): """ Wraps a single assembly file in appropriate defines. """ - sink.write("#if defined(%s) && defined(%s)\n" % (pp_arch, pp_platform)) + sink.write(b"#if defined(%b) && defined(%b)\n" % (pp_arch.encode(), pp_platform.encode())) for line in source_lines: sink.write(line) - sink.write("#endif // defined(%s) && defined(%s)\n" % (pp_arch, pp_platform)) + sink.write(b"#endif // defined(%b) && defined(%b)\n" % (pp_arch.encode(), pp_platform.encode())) def munge_all_files(osname, arch, asms): @@ -214,10 +214,10 @@ def main(): # Now we need to bring over all the .S files, inserting our preprocessor # directives along the way. We do this to allow the C preprocessor to make # unneeded assembly files vanish. - for ((osname, arch), asm_files) in asm_outputs.iteritems(): + for ((osname, arch), asm_files) in asm_outputs.items(): munge_all_files(osname, arch, asm_files) - for ((osname, arch), asm_files) in NON_PERL_FILES.iteritems(): + for ((osname, arch), asm_files) in NON_PERL_FILES.items(): for asm_file in asm_files: with open(asm_file, 'rb') as f: lines = f.readlines()