Merge pull request #171 from camelot-dev/fix-169

Change error name and update pdfminer.six version
pull/130/head
Vinayak Mehta 2020-07-21 21:30:14 +05:30 committed by GitHub
commit be25e6dbdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -14,7 +14,7 @@ import numpy as np
from pdfminer.pdfparser import PDFParser
from pdfminer.pdfdocument import PDFDocument
from pdfminer.pdfpage import PDFPage
from pdfminer.pdfpage import PDFTextExtractionNotAllowed
from pdfminer.pdfpage import PDFTextExtractionNotAllowedError
from pdfminer.pdfinterp import PDFResourceManager
from pdfminer.pdfinterp import PDFPageInterpreter
from pdfminer.converter import PDFPageAggregator
@ -780,7 +780,7 @@ def get_page_layout(
parser = PDFParser(f)
document = PDFDocument(parser)
if not document.is_extractable:
raise PDFTextExtractionNotAllowed
raise PDFTextExtractionNotAllowedError(f"Text extraction is not allowed: {filename}")
laparams = LAParams(
char_margin=char_margin,
line_margin=line_margin,

View File

@ -5,6 +5,6 @@ numpy>=1.13.3
opencv-python>=3.4.2.17
openpyxl>=2.5.8
pandas>=0.23.4
pdfminer.six>=20170720
pdfminer.six>=20200720
PyPDF2>=1.26.0
Sphinx>=1.7.9

View File

@ -19,7 +19,7 @@ requires = [
'numpy>=1.13.3',
'openpyxl>=2.5.8',
'pandas>=0.23.4',
'pdfminer.six>=20170720',
'pdfminer.six>=20200720',
'PyPDF2>=1.26.0'
]