Skip to content

Commit bcd6384

Browse files
Do not use deprecated pdfParser close method
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
1 parent 5d29b93 commit bcd6384

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/typecode/contenttype.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -638,9 +638,9 @@ def is_pdf_with_text(self):
638638
else:
639639
with open(self.location, "rb") as pf:
640640
try:
641-
with contextlib.closing(PDFParser(pf)) as parser:
642-
doc = PDFDocument(parser)
643-
self._is_pdf_with_text = doc.is_extractable
641+
parser = PDFParser(pf)
642+
doc = PDFDocument(parser)
643+
self._is_pdf_with_text = doc.is_extractable
644644
except (PDFSyntaxError, PSSyntaxError, PDFException, PDFEncryptionError):
645645
self._is_pdf_with_text = False
646646
return self._is_pdf_with_text

0 commit comments

Comments
 (0)