We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6ec1682 commit fb1df70Copy full SHA for fb1df70
1 file changed
lib/matplotlib/tests/test_backend_pdf.py
@@ -5,6 +5,7 @@
5
import string
6
7
import numpy as np
8
+from packaging.version import parse as parse_version
9
import pytest
10
11
import matplotlib as mpl
@@ -112,7 +113,10 @@ def test_indexed_image():
112
113
114
with pikepdf.Pdf.open(buf) as pdf:
115
page, = pdf.pages
- image, = page.images.values()
116
+ if parse_version(pikepdf.__version__) < parse_version('10.9.0'):
117
+ image, = page.images.values()
118
+ else:
119
+ image, = page.get_images().values()
120
pdf_image = pikepdf.PdfImage(image)
121
assert pdf_image.indexed
122
pil_image = pdf_image.as_pil_image()
0 commit comments