python3: make kakasi build

Since these are all being opened as non-binary, it makes no sense to
then immediately decode them.
This commit is contained in:
Eli Schwartz 2019-03-21 00:23:43 -04:00
parent 8aceae428e
commit c940d9941a
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6

View File

@ -168,7 +168,7 @@ class Kakasi(Command): # {{{
def mkitaiji(self, src, dst):
dic = {}
for line in open(src, "r"):
line = line.decode("utf-8").strip()
line = line.strip()
if line.startswith(';;'): # skip comment
continue
if re.match(r"^$",line):
@ -182,7 +182,7 @@ class Kakasi(Command): # {{{
def mkkanadict(self, src, dst):
dic = {}
for line in open(src, "r"):
line = line.decode("utf-8").strip()
line = line.strip()
if line.startswith(';;'): # skip comment
continue
if re.match(r"^$",line):
@ -194,7 +194,7 @@ class Kakasi(Command): # {{{
f.write(msgpack_dumps(dic))
def parsekdict(self, line):
line = line.decode("utf-8").strip()
line = line.strip()
if line.startswith(';;'): # skip comment
return
(yomi, kanji) = line.split(' ')