added more python 3 support by Sworddragon

This commit is contained in:
oy 2011-01-29 20:00:39 +01:00
parent 9c6843946c
commit b5b33b45fa

View file

@ -18,8 +18,8 @@ def cstrip(lines):
# this eats up cases like 'n {'
i = 1
while i < len(d)-2:
if d[i] == ' ':
if not (d[i-1] in alphanum and d[i+1] in alphanum):
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:]
i += 1
return d