Fix syntax error with Python 2

Python 2 wants b"..." and gives error win rb"...".
This commit is contained in:
Enrico Forestieri 2020-02-06 10:50:02 +01:00
parent 5188f0fcff
commit 4e3567523a

View 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")