From: Enrico Forestieri Date: Thu, 6 Feb 2020 09:50:02 +0000 (+0100) Subject: Fix syntax error with Python 2 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=9eabd74ff31b564a081ed531eb94a870db36305c;p=features.git Fix syntax error with Python 2 Python 2 wants b"..." and gives error win rb"...". --- 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")