Kaydet (Commit) 1dec3cb2 authored tarafından Phillip Sz's avatar Phillip Sz Kaydeden (comit) Samuel Mehrbrodt

find-german-comments: let's use python 3

Under python 3 we must use bytes.

Change-Id: I86d2a875f4e06a9cb9724d86348f420bb8ea19e9
Reviewed-on: https://gerrit.libreoffice.org/25084Reviewed-by: 's avatarSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: 's avatarSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
üst 21a68e17
#!/usr/bin/env python2 #!/usr/bin/env python3
######################################################################## ########################################################################
# #
# Copyright (c) 2010 Jonas Jensen, Miklos Vajna # Copyright (c) 2010 Jonas Jensen, Miklos Vajna
...@@ -131,8 +131,8 @@ class Parser: ...@@ -131,8 +131,8 @@ class Parser:
unsure, just don't warn, there are strings where you just can't unsure, just don't warn, there are strings where you just can't
teremine the results reliably, like '#110680#' """ teremine the results reliably, like '#110680#' """
self.text_cat.stdin.write(s) self.text_cat.stdin.write(bytes(s, 'utf-8'))
self.text_cat.stdin.write("\n") self.text_cat.stdin.write(bytes("\n", 'utf-8'))
self.text_cat.stdin.flush() self.text_cat.stdin.flush()
lang = self.text_cat.stdout.readline().strip() lang = self.text_cat.stdout.readline().strip()
return lang return lang
...@@ -146,7 +146,7 @@ class Parser: ...@@ -146,7 +146,7 @@ class Parser:
s = s.replace('\n', ' ') s = s.replace('\n', ' ')
if len(s) < 32 or len(s.split()) < 4: if len(s) < 32 or len(s.split()) < 4:
return False return False
return "german" == self.get_lang(s) return b"german" == self.get_lang(s)
def check_file(self, path): def check_file(self, path):
""" """
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment