From acb42d737de7f2472862d5ac6f9471640a8415b1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 23 Aug 2020 14:30:43 +0530 Subject: [PATCH] py3 compat --- setup/translations.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup/translations.py b/setup/translations.py index 4b646df01f..481a6b2622 100644 --- a/setup/translations.py +++ b/setup/translations.py @@ -241,7 +241,7 @@ class POT(Command): # {{{ ] + qt_inputs) with open(out.name, 'rb') as f: - src = f.read() + src = f.read().decode('utf-8') os.remove(out.name) src = pot_header + '\n' + src src += '\n\n' + self.get_tweaks_docs() @@ -254,12 +254,12 @@ class POT(Command): # {{{ src = re.sub(r'#, python-brace-format\s+msgid ""\s+.*{0:', lambda m: m.group().replace('python-brace', 'no-python-brace'), src) with open(pot, 'wb') as f: - f.write(src) + f.write(src.encode('utf-8')) self.info('Translations template:', os.path.abspath(pot)) self.upload_pot(resource='main') self.git(['add', os.path.abspath(pot)]) - if self.git('diff-index --cached --quiet --ignore-submodules HEAD --', use_call=True) != 0: + if not is_ci and self.git('diff-index --cached --quiet --ignore-submodules HEAD --', use_call=True) != 0: self.git(['commit', '-m', 'Updated translation templates']) self.git('push')