--- a/i18n.py Tue Oct 06 11:44:51 2015 +0200
+++ b/i18n.py Mon Oct 05 17:57:03 2015 +0200
@@ -25,6 +25,8 @@
from os.path import join, basename, splitext, exists
from glob import glob
+from six import PY2
+
from cubicweb.toolsutils import create_dir
def extract_from_tal(files, output_file):
@@ -40,10 +42,10 @@
def add_msg(w, msgid, msgctx=None):
"""write an empty pot msgid definition"""
- if isinstance(msgid, unicode):
+ if PY2 and isinstance(msgid, unicode):
msgid = msgid.encode('utf-8')
if msgctx:
- if isinstance(msgctx, unicode):
+ if PY2 and isinstance(msgctx, unicode):
msgctx = msgctx.encode('utf-8')
w('msgctxt "%s"\n' % msgctx)
msgid = msgid.replace('"', r'\"').splitlines()