]> git.lyx.org Git - features.git/commitdiff
Fix AttributeError with Python 3.
authorGünter Milde <milde@lyx.org>
Thu, 28 Feb 2019 21:59:30 +0000 (22:59 +0100)
committerGünter Milde <milde@lyx.org>
Thu, 28 Feb 2019 21:59:30 +0000 (22:59 +0100)
At least since Python 3.5, `output` is already a
(unicode) string and does not have a "decode" method.

lib/scripts/convertDefault.py

index 8678965013a5aa22b0d0d73ab1c3779efebab848..0c9b6a60db7af381a7a4a4449aa240dc0f3fa892 100644 (file)
@@ -35,7 +35,10 @@ if fout.close() != None:
     output = fout.readline()
     fout.close()
 if not PY2:
-    output = output.decode()
+    # Ensure we have a (unicode) string object in Python3
+    # (not required for version >= 3.5).
+    # FIXME: Check whether this is required with any supported 3.x version!
+    output = str(output)
 
 version = re_version.match(output)