Commit 3a1fbf3
committed
Fix Pillow import in testing.
The expected import is `from PIL import Image`, and if you import the
compare function directly, it will fail:
```
>>> from matplotlib.testing.compare import compare_images
>>> compare_images('a.png', 'b.png', 0)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File ".../matplotlib/testing/compare.py", line 394, in compare_images
expected_image = np.asarray(PIL.Image.open(expected).convert("RGB"))
AttributeError: module 'PIL' has no attribute 'Image'
```
It only works in our test suite because some other file does it
correctly.1 parent df67aaf commit 3a1fbf3
1 file changed
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
394 | | - | |
395 | | - | |
| 394 | + | |
| 395 | + | |
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
| |||
442 | 442 | | |
443 | 443 | | |
444 | 444 | | |
445 | | - | |
446 | | - | |
| 445 | + | |
| 446 | + | |
447 | 447 | | |
448 | 448 | | |
449 | 449 | | |
| |||
469 | 469 | | |
470 | 470 | | |
471 | 471 | | |
472 | | - | |
| 472 | + | |
0 commit comments