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:
@@ -454,7 +454,7 @@ def _transcode_png(pike: Pdf, filename: Path, xref: Xref) -> bool:
|
||||
img2pdf.convert(fspath(filename), outputstream=f)
|
||||
|
||||
with Pdf.open(output) as pdf_image:
|
||||
foreign_image = next(pdf_image.pages[0].images.values())
|
||||
foreign_image = next(iter(pdf_image.pages[0].images.values()))
|
||||
local_image = pike.copy_foreign(foreign_image)
|
||||
|
||||
im_obj = pike.get_object(xref, 0)
|
||||
|
||||
Reference in New Issue
Block a user