Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
testlib: fix Pillow type annotations
Pillow upstream added a `py.typed` file in their last release, which is causing us problems because: - we `from PIL import Image`, which kinda looks like the class `Image` in the `PIL` module, but is actually a submodule. In particular, `PIL.Image.open()` is not a static method, but a function call, and it doesn't return `PIL.Image`, but rather `PIL.Image.Image`. Fix a couple of annotations. - our hacks for setting `Image = None` if the import is missing are no longer working (since the import now has a better type than `Any`). Let's make the import unconditional. `dnf install python3-pillow`. - several methods are unannotated in the upstream code, leading to warnings about "untyped call from typed code". We use an #ignore for those; cf. python-pillow/Pillow#8029
- Loading branch information