]> git.lyx.org Git - features.git/commitdiff
Fix literal string in binary context
authorJuergen Spitzmueller <spitz@lyx.org>
Fri, 13 Oct 2017 08:04:27 +0000 (10:04 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Fri, 13 Oct 2017 08:04:27 +0000 (10:04 +0200)
In 1a26f9b26cff827da5, all strings in the context of regexes and
comparisons have been converted to byte-like objects for python2/3
compatibility reasons. This has not been considered in the later
commit 5c545573507bb, which makes layout2layout break with
TypeError: can't concat str to bytes.

lib/scripts/layout2layout.py

index eebacf883d544a91656d51e71d9779811d6ed919..77cafa048ae50413e12364ea1d995885e7b0ece3 100644 (file)
@@ -471,7 +471,7 @@ def convert(lines, end_format):
               re_trimEndLabelString, re_trimLabelCounter):
                 m = r.match(lines[i])
                 if m:
-                    lines[i] = m.group(1) + '"' + m.group(2) + '"'
+                    lines[i] = m.group(1) + b'"' + m.group(2) + b'"'
             i += 1
             continue