Avoid call to deprecated pdf.check() where possible
This commit is contained in:
@@ -270,7 +270,10 @@ def check_pdf(input_file: Path) -> bool:
|
||||
with pdf:
|
||||
with warnings.catch_warnings():
|
||||
warnings.filterwarnings('ignore', message=r'pikepdf.*JBIG2.*')
|
||||
messages = pdf.check()
|
||||
if hasattr(pdf, 'check_pdf_syntax'):
|
||||
messages = pdf.check_pdf_syntax() # pikepdf >= 9.10.0
|
||||
else:
|
||||
messages = pdf.check()
|
||||
success = True
|
||||
for msg in messages:
|
||||
if 'error' in msg.lower():
|
||||
|
||||
Reference in New Issue
Block a user