diff options
author | Matthias Hoelzl <tc@xantira.com> | 2017-08-26 18:53:49 +0200 |
---|---|---|
committer | Matthias Hoelzl <tc@xantira.com> | 2017-08-27 23:05:39 +0200 |
commit | b6e1e47e3a92c1b94ef327149068a8a147fc73f5 (patch) | |
tree | 649111f4d36d3a1a12048db41e9d72026a787d6b /main/SCsub | |
parent | a919a013f53bdd9535d248ad9fdbb586c342a4d6 (diff) |
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.
Diffstat (limited to 'main/SCsub')
-rw-r--r-- | main/SCsub | 11 |
1 files changed, 6 insertions, 5 deletions
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") |