[LyX/master] Fix syntax error with Python 2

Enrico Forestieri forenr at lyx.org
Thu Feb 6 09:33:55 UTC 2020


commit 4e3567523a18eb5519f88199eb81f260346a0e38
Author: Enrico Forestieri <forenr at lyx.org>
Date:   Thu Feb 6 10:50:02 2020 +0100

    Fix syntax error with Python 2
    
    Python 2 wants b"..." and gives error win rb"...".
---
 lib/scripts/lyxpreview_tools.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/scripts/lyxpreview_tools.py b/lib/scripts/lyxpreview_tools.py
index 2f8c2f8..05c5aad 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")
 


More information about the lyx-cvs mailing list