]> git.lyx.org Git - features.git/commitdiff
Fix syntax error with Python 2
authorEnrico Forestieri <forenr@lyx.org>
Thu, 6 Feb 2020 09:50:02 +0000 (10:50 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 13:48:51 +0000 (15:48 +0200)
Python 2 wants b"..." and gives error win rb"...".

lib/scripts/lyxpreview_tools.py

index 2f8c2f8d643a7b13a48ea00645d96d5e52834591..05c5aad6163467df62ed76768ccd8fc3ce2418cc 100644 (file)
@@ -219,7 +219,7 @@ def write_metrics_info(metrics_info, metrics_file):
 # Reads a .tex files and create an identical file but only with
 # pages whose index is in pages_to_keep
 def filter_pages(source_path, destination_path, pages_to_keep):
-    def_re = re.compile(rb"(\\newcommandx|\\renewcommandx|\\global\\long\\def)(\\[a-zA-Z]+)(.+)")
+    def_re = re.compile(b"(\\newcommandx|\\renewcommandx|\\global\\long\\def)(\\[a-zA-Z]+)(.+)")
     source_file = open(source_path, "rb")
     destination_file = open(destination_path, "wb")