From dbaa892665c880c7d15699ac31dcbb635292c2b4 Mon Sep 17 00:00:00 2001 From: sabaimran Date: Sat, 4 Nov 2023 19:34:10 -0700 Subject: [PATCH] Flip catching modulenotfound to import error exception --- src/khoj/processor/pdf/pdf_to_entries.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/khoj/processor/pdf/pdf_to_entries.py b/src/khoj/processor/pdf/pdf_to_entries.py index 64e13031..78ba034e 100644 --- a/src/khoj/processor/pdf/pdf_to_entries.py +++ b/src/khoj/processor/pdf/pdf_to_entries.py @@ -70,7 +70,7 @@ class PdfToEntries(TextToEntries): f.write(bytes) try: loader = PyMuPDFLoader(f"{tmp_file}", extract_images=True) - except ModuleNotFoundError: + except ImportError: loader = PyMuPDFLoader(f"{tmp_file}") pdf_entries_per_file = [page.page_content for page in loader.load()] entry_to_location_map += zip(pdf_entries_per_file, [pdf_file] * len(pdf_entries_per_file))