1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
| | Fix import errors during tests.
See https://github.com/pdfminer/pdfminer.six/issues/896
This patch has been taken from
https://build.opensuse.org/package/view_file/openSUSE:Factory/python-pdfminer.six/import-from-non-pythonpath-files.patch
diff '--color=auto' -rub pdfminer.six-20221105.orig/tests/test_tools_dumppdf.py pdfminer.six-20221105/tests/test_tools_dumppdf.py
--- pdfminer.six-20221105.orig/tests/test_tools_dumppdf.py 2022-11-05 12:22:08.000000000 -0400
+++ pdfminer.six-20221105/tests/test_tools_dumppdf.py 2023-12-11 12:12:06.044210731 -0500
@@ -4,7 +4,11 @@
from helpers import absolute_sample_path
from tempfilepath import TemporaryFilePath
-from tools import dumppdf
+
+import importlib.util
+spec = importlib.util.spec_from_file_location("dumppdf", "tools/dumppdf.py")
+dumppdf = importlib.util.module_from_spec(spec)
+spec.loader.exec_module(dumppdf)
def run(filename, options=None):
diff '--color=auto' -rub pdfminer.six-20221105.orig/tests/test_tools_pdf2txt.py pdfminer.six-20221105/tests/test_tools_pdf2txt.py
--- pdfminer.six-20221105.orig/tests/test_tools_pdf2txt.py 2022-11-05 12:22:08.000000000 -0400
+++ pdfminer.six-20221105/tests/test_tools_pdf2txt.py 2023-12-11 12:12:40.848031179 -0500
@@ -3,10 +3,13 @@
from tempfile import mkdtemp
import filecmp
-import tools.pdf2txt as pdf2txt
from helpers import absolute_sample_path
from tempfilepath import TemporaryFilePath
+import importlib.util
+spec = importlib.util.spec_from_file_location("pdf2txt", "tools/pdf2txt.py")
+pdf2txt = importlib.util.module_from_spec(spec)
+spec.loader.exec_module(pdf2txt)
def run(sample_path, options=None):
absolute_path = absolute_sample_path(sample_path)
|