[Libreoffice-commits] core.git: solenv/bin

Caolán McNamara caolanm at redhat.com
Fri Jul 21 15:04:03 UTC 2017


 solenv/bin/interim-update-module-for-gettext |    6 +++---
 solenv/bin/polib.py                          |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 7a7cba91a60c1c6d6645dfb8c7e88c5c6318ddee
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jul 21 15:31:24 2017 +0100

    fix python2 assumption
    
    Change-Id: I2113f64bac9f1e7421416266d20004b35ddbc54b

diff --git a/solenv/bin/interim-update-module-for-gettext b/solenv/bin/interim-update-module-for-gettext
index 67aecd9b6848..596401f5ca23 100755
--- a/solenv/bin/interim-update-module-for-gettext
+++ b/solenv/bin/interim-update-module-for-gettext
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
 
 import binascii
 import polib
@@ -14,13 +14,13 @@ if len(sys.argv) < 2:
 uiline = False
 
 subpath = sys.argv[1]
-print >> sys.stderr, "interim-update-for-gettext: processing ", subpath
+print("interim-update-for-gettext: processing " + subpath)
 messages = None
 npos = 0
 for dirpath, dirname, filenames in walk(subpath):
     for filename in filenames:
         ipath = join(dirpath, filename)
-        print >> sys.stderr, "interim-update-for-gettext: merging ", ipath
+        print("interim-update-for-gettext: merging " + ipath)
         po = polib.pofile(ipath)
         if len(po) != 0:
             samplefile = po[0].occurrences[0][0]
diff --git a/solenv/bin/polib.py b/solenv/bin/polib.py
index b835167729e8..ef873541bb7e 100644
--- a/solenv/bin/polib.py
+++ b/solenv/bin/polib.py
@@ -867,7 +867,7 @@ class _BaseEntry(object):
                                    wrapwidth)
         ret.append('')
         usedirect = True
-        if type(ret[0] != unicode):
+        if not PY3 and type(ret[0] != unicode):
             try:
                 usedirect = False
                 ret = u('\n').join(x.decode('utf-8') for x in ret)


More information about the Libreoffice-commits mailing list