From 6c966f2afa504570e511ee327f6fff01577ef0fc Mon Sep 17 00:00:00 2001 From: jvoisin Date: Thu, 9 Jan 2025 01:21:31 +0100 Subject: Significantly improve portability --- libmat2/pdf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libmat2/pdf.py') diff --git a/libmat2/pdf.py b/libmat2/pdf.py index 2da21b5..0672214 100644 --- a/libmat2/pdf.py +++ b/libmat2/pdf.py @@ -136,8 +136,8 @@ class PDFParser(abstract.AbstractParser): # It should(tm) be alright though, because cairo's output format # for metadata is fixed. with open(out_file, 'rb') as f: - out = re.sub(rb'<<[\s\n]*/Producer.*?>>', b' << >>', f.read(), 0, - re.DOTALL | re.IGNORECASE) + out = re.sub(rb'<<[\s\n]*/Producer.*?>>', b' << >>', f.read(), + count=0, flags=re.DOTALL | re.IGNORECASE) with open(out_file, 'wb') as f: f.write(out) -- cgit v1.3