summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-07-21 15:31:24 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-07-21 16:03:24 +0100
commit7a7cba91a60c1c6d6645dfb8c7e88c5c6318ddee (patch)
tree522740688ce6e29c4bf336d830d6b2c74a020e74
parentloplugin:subtlezeroinit (diff)
downloadcore-7a7cba91a60c1c6d6645dfb8c7e88c5c6318ddee.tar.gz
core-7a7cba91a60c1c6d6645dfb8c7e88c5c6318ddee.zip
fix python2 assumption
Change-Id: I2113f64bac9f1e7421416266d20004b35ddbc54b
-rwxr-xr-xsolenv/bin/interim-update-module-for-gettext6
-rw-r--r--solenv/bin/polib.py2
2 files changed, 4 insertions, 4 deletions
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)