diff options
author | Phillip Sz <phillip.szelat@gmail.com> | 2016-05-18 11:38:53 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2016-05-18 10:18:24 +0000 |
commit | 1dec3cb29bd7ec028d6b2139d0199225b5cf5d67 (patch) | |
tree | d4e03c946f7aa5e1240a9c6274ed2eb0b40432df /bin | |
parent | 21a68e1745dec1f4c4fd5b90d3a58000ed11c324 (diff) |
find-german-comments: let's use python 3
Under python 3 we must use bytes.
Change-Id: I86d2a875f4e06a9cb9724d86348f420bb8ea19e9
Reviewed-on: https://gerrit.libreoffice.org/25084
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/find-german-comments | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/find-german-comments b/bin/find-german-comments index 53dbd1daa89a..86dfe547247f 100755 --- a/bin/find-german-comments +++ b/bin/find-german-comments @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 ######################################################################## # # Copyright (c) 2010 Jonas Jensen, Miklos Vajna @@ -131,8 +131,8 @@ class Parser: unsure, just don't warn, there are strings where you just can't teremine the results reliably, like '#110680#' """ - self.text_cat.stdin.write(s) - self.text_cat.stdin.write("\n") + self.text_cat.stdin.write(bytes(s, 'utf-8')) + self.text_cat.stdin.write(bytes("\n", 'utf-8')) self.text_cat.stdin.flush() lang = self.text_cat.stdout.readline().strip() return lang @@ -146,7 +146,7 @@ class Parser: s = s.replace('\n', ' ') if len(s) < 32 or len(s.split()) < 4: return False - return "german" == self.get_lang(s) + return b"german" == self.get_lang(s) def check_file(self, path): """ |