From 4e3567523a18eb5519f88199eb81f260346a0e38 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Thu, 6 Feb 2020 10:50:02 +0100 Subject: [PATCH] Fix syntax error with Python 2 Python 2 wants b"..." and gives error win rb"...". --- lib/scripts/lyxpreview_tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/scripts/lyxpreview_tools.py b/lib/scripts/lyxpreview_tools.py index 2f8c2f8d64..05c5aad616 100644 --- a/lib/scripts/lyxpreview_tools.py +++ b/lib/scripts/lyxpreview_tools.py @@ -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")