py3: Fix checking of iso639 translations

This commit is contained in:
Kovid Goyal 2019-03-31 18:38:32 +05:30
parent e73dbb0f99
commit 4a3c9ca32f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -430,6 +430,8 @@ class Translations(POT): # {{{
rmap = {} rmap = {}
msgid = None msgid = None
has_errors = False has_errors = False
if isinstance(raw, bytes):
raw = raw.decode('utf-8')
for match in re.finditer(r'^(msgid|msgstr)\s+"(.*?)"', raw, re.M): for match in re.finditer(r'^(msgid|msgstr)\s+"(.*?)"', raw, re.M):
if match.group(1) == 'msgid': if match.group(1) == 'msgid':
msgid = match.group(2) msgid = match.group(2)