From 4ff61fcdaa84e874c862374976bf06bb1f367b7f Mon Sep 17 00:00:00 2001 From: Sworddragon Date: Thu, 6 Jan 2011 00:51:31 +0100 Subject: Made compiling process Python 3 compatible --- scripts/cmd5.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/cmd5.py b/scripts/cmd5.py index df8f8d7a..8402a2bf 100644 --- a/scripts/cmd5.py +++ b/scripts/cmd5.py @@ -26,12 +26,11 @@ def cstrip(lines): f = "" for filename in sys.argv[1:]: - f += cstrip([l.strip() for l in file(filename)]) + f += cstrip([l.decode("iso8859-1").strip() for l in open(filename, "rb")]) - -hash = hashlib.md5(f).hexdigest().lower()[16:] +hash = hashlib.md5(f.encode()).hexdigest().lower()[16:] # TODO: refactor hash that is equal to the 0.5 hash, remove when we # TODO: remove when we don't need it any more if hash == "026b8eceb4cdd369": hash = "b67d1f1a1eea234e" -print '#define GAME_NETVERSION_HASH "%s"' % hash +print('#define GAME_NETVERSION_HASH "%s"' % hash) -- cgit 1.4.1