Yaz Hobooti commited on
Commit
ee41863
·
1 Parent(s): b489434

Fix second syntax error: correct indentation of except block in PyMuPDF fallback

Browse files

- Fixed malformed try-except block at line 408
- Corrected indentation of except block to align with try block in PyMuPDF section
- Resolves SyntaxError: expected 'except' or 'finally' block
- Ensures proper exception handling in PDF loading fallback function

Files changed (1) hide show
  1. pdf_comparator.py +1 -1
pdf_comparator.py CHANGED
@@ -405,7 +405,7 @@ def load_pdf_pages(path: str, dpi: int = 400, max_pages: int = 5) -> List[Image.
405
  pages.append(img.convert("RGB"))
406
  doc.close()
407
  return pages
408
- except Exception as e:
409
  raise ValueError(f"Failed to convert PDF with both pdf2image and PyMuPDF. pdf2image error: poppler not found. PyMuPDF error: {str(e)}")
410
  else:
411
  raise ValueError(f"Failed to convert PDF to image with all poppler paths. Last error: poppler not found. PyMuPDF not available as fallback.")
 
405
  pages.append(img.convert("RGB"))
406
  doc.close()
407
  return pages
408
+ except Exception as e:
409
  raise ValueError(f"Failed to convert PDF with both pdf2image and PyMuPDF. pdf2image error: poppler not found. PyMuPDF error: {str(e)}")
410
  else:
411
  raise ValueError(f"Failed to convert PDF to image with all poppler paths. Last error: poppler not found. PyMuPDF not available as fallback.")