Fix test failures on pikepdf 3.2.0 + pybind11 2.8.0

When compiled without pybind11 2.8.0, pikepdf supplies a shim to implement
pikepdf._ObjectMapping.values() which has subtly different semantics
from a true dict-like objects; in particular it supports
next(objectmap.values())
where a standard dict requires
next(iter(objectmap.values()).

pybind11 2.8.0 now implements .values() properly, meaning some misuses of
protocol  in ocrmypdf fail.

If pybind11 < 2.8.0, pikepdf will
continue to offer its shim. If pybind11 >= 2.8.0, pikepdf does not add its shim.

Consequently no changes were needed in pikepdf.

Closes #843
This commit is contained in:
James R. Barlow
2021-10-12 13:38:52 -07:00
parent 78f391536b
commit 690f88119d
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -87,4 +87,4 @@ def test_jpeg_in_jpeg_out(resources, outpdf):
'tests/plugins/tesseract_noop.py',
)
with pikepdf.open(outpdf) as pdf:
assert next(pdf.pages[0].images.values()).Filter == pikepdf.Name.DCTDecode
assert next(iter(pdf.pages[0].images.values())).Filter == pikepdf.Name.DCTDecode