From 02bd5663623d6ea7b91d88e4747ad2da18ff711f Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Tue, 28 Oct 2014 03:55:43 +0000 Subject: [PATCH] Update other scripts to support Python 3 build. A couple of scripts were not Python 3 compatible. Update smtextgen to use print() instead of bare print, and update the texture build script to use the correct binary mode for writing binary files. --- graphics/text/smtextgen | 6 +++--- lumps/textures/build-textures | 13 +++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/graphics/text/smtextgen b/graphics/text/smtextgen index d15f3a04..9f3fbf42 100755 --- a/graphics/text/smtextgen +++ b/graphics/text/smtextgen @@ -140,9 +140,9 @@ def parse_command_line(args): args = parse_command_line(sys.argv[1:]) if not args: - print "Usage: smtextgen [...text commands...]" - print "Where each text command looks like:" - print " [x,y] [text]" + print("Usage: smtextgen [...text commands...]") + print("Where each text command looks like:") + print(" [x,y] [text]") sys.exit(0) smallfont = Font() diff --git a/lumps/textures/build-textures b/lumps/textures/build-textures index 46f6176b..a48d987c 100755 --- a/lumps/textures/build-textures +++ b/lumps/textures/build-textures @@ -139,7 +139,7 @@ class TextureSet(collections.OrderedDict): filename: Path to file in which to store the resulting lump. """ - with open(filename, "w") as out: + with open(filename, "wb") as out: # Header indicating number of textures: out.write(struct.pack("