Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Simplify pillow imports and version detection #59
This simplifies the importing and version detection for Pillow by using the imports recommended by Pillow exclusively without fallbacks:
As expectd, the version detection seems to work fine for all versions down to Pillow 3.4.0:
As expected, below 3.4.0,
I've tested the regular imports (i.e. not the version detection, but normal operation) against Pillow 3.4.0 and 6.2.1 using
Previously, this tried various combinations of version variables. However, some of these are deprecated by Pillow and the 6.0.0 release notes recommend simply using `PIL.__version` instead. This attribute is available since Pillow 3.4.0, so there is no need for any compatibility fallbacks. This relates to #29, #39 and #54.
Previously, this tried a fallback to `import Image`, but Pillow has stopped supporting that in version 1.0, so there is no need to keep carrying that around. Note that in some places, an ImportError for Pillow was and still is ignored, since Pillow is not required for all codepaths. See commit 5612c5b where this was introduced.
Hm, somehow github did not e-mail me about comments to this PR, so I'm a bit late to reply.
I've just rebased and force pushed and all checks were succesful. I would be happy if this could be merged, then I can backport to the Debian package and prevent that from being removed from Debian/testing in a few days due to build failures :-p