about summary refs log tree commit diff
path: root/scripts/cmd5.py
diff options
context:
space:
mode:
authorroot <root@ubuntu.localdomain>2011-02-06 19:18:31 +0100
committeroy <Tom_Adams@web.de>2011-02-09 12:39:29 +0100
commit75f854584d6294cc94071229cf0f898f45de128b (patch)
tree1cf778a7a4e619c5c2d5630d7f647a8df9713dcc /scripts/cmd5.py
parentf5de59451aac2ca76cee192c00d34bf9fad5e2f3 (diff)
downloadzcatch-75f854584d6294cc94071229cf0f898f45de128b.tar.gz
zcatch-75f854584d6294cc94071229cf0f898f45de128b.zip
Fixed wrong nethash creation with Python 3
Diffstat (limited to 'scripts/cmd5.py')
-rw-r--r--scripts/cmd5.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/cmd5.py b/scripts/cmd5.py
index 5f08e1d2..929c05a7 100644
--- a/scripts/cmd5.py
+++ b/scripts/cmd5.py
@@ -1,6 +1,6 @@
 import hashlib, sys, re
 
-alphanum = "0123456789abcdefghijklmnopqrstuvwzyxABCDEFGHIJKLMNOPQRSTUVWXYZ_"
+alphanum = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_".encode()
 
 def cstrip(lines):
 	d = "".encode()
@@ -12,15 +12,15 @@ def cstrip(lines):
 	d = d.replace("\t".encode(), " ".encode()) # tab to space
 	d = re.sub("  *".encode(), " ".encode(), d) # remove double spaces
 	d = re.sub("".encode(), "".encode(), d) # remove /* */ comments
-	
+
 	d = d.strip()
-	
+
 	# this eats up cases like 'n {'
 	i = 1
 	while i < len(d)-2:
-		if d[i:i + 1] == " ":
-			if not (d[i-1:i] in alphanum and d[i+1:i + 2] in alphanum):
-				d = d[:i] + d[i+1:]
+		if d[i:i + 1] == " ".encode():
+			if not (d[i - 1:i] in alphanum and d[i+1:i + 2] in alphanum):
+				d = d[:i] + d[i + 1:]
 		i += 1
 	return d