From b6e1e47e3a92c1b94ef327149068a8a147fc73f5 Mon Sep 17 00:00:00 2001 From: Matthias Hoelzl Date: Sat, 26 Aug 2017 18:53:49 +0200 Subject: Make build scripts Python3 compatible - The Windows, UWP, Android (on Windows) and Linux builds are tested with Scons 3.0 alpha using Python 3. - OSX and iOS should hopefully work but are not tested since I don't have a Mac. - Builds using SCons 2.5 and Python 2 should not be impacted. --- main/SCsub | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'main/SCsub') diff --git a/main/SCsub b/main/SCsub index f0ff9e9639..1f97cd1be0 100644 --- a/main/SCsub +++ b/main/SCsub @@ -1,6 +1,7 @@ #!/usr/bin/env python Import('env') +from compat import byte_to_str def make_splash(target, source, env): @@ -8,17 +9,17 @@ def make_splash(target, source, env): src = source[0].srcnode().abspath dst = target[0].srcnode().abspath f = open(src, "rb") - g = open(dst, "wb") + g = open(dst, "w") buf = f.read() g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n") g.write("#ifndef BOOT_SPLASH_H\n") g.write("#define BOOT_SPLASH_H\n") - g.write("static const Color boot_splash_bg_color = Color(1,1,1,1);\n"); + g.write("static const Color boot_splash_bg_color = Color(1,1,1,1);\n") g.write("static const unsigned char boot_splash_png[] = {\n") for i in range(len(buf)): - g.write(str(ord(buf[i])) + ",\n") + g.write(byte_to_str(buf[i]) + ",\n") g.write("};\n") g.write("#endif") @@ -28,7 +29,7 @@ def make_app_icon(target, source, env): src = source[0].srcnode().abspath dst = target[0].srcnode().abspath f = open(src, "rb") - g = open(dst, "wb") + g = open(dst, "w") buf = f.read() @@ -37,7 +38,7 @@ def make_app_icon(target, source, env): g.write("#define APP_ICON_H\n") g.write("static const unsigned char app_icon_png[] = {\n") for i in range(len(buf)): - g.write(str(ord(buf[i])) + ",\n") + g.write(byte_to_str(buf[i]) + ",\n") g.write("};\n") g.write("#endif") -- cgit v1.2.3