about summary refs log tree commit diff
path: root/scripts/cmd5.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/cmd5.py')
-rw-r--r--scripts/cmd5.py7
1 files changed, 3 insertions, 4 deletions
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)