| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
It really annoys me that the string "3.4" is hardcoded in several places in the code, instead of being in one place that it is pulled from, but I guess there's no easy way to do that? |
Sorry, something went wrong.
|
This PR changes the code to have that number appear only once in the code, namely in backend_bases.py. Any descendent backend can import _has_pil. Or are you saying the documentation should pull it from the code? |
Sorry, something went wrong.
|
Yeah, ideally. Presumably it's also defined in a pip requirements file somewhere too. |
Sorry, something went wrong.
| _has_pil = True | ||
| del Image | ||
| except ImportError: | ||
| except (ImportError, AssertionError): |
There was a problem hiding this comment.
Instead of catching an AssertionError, I think it would be better to have an if block that checks the version.
Sorry, something went wrong.
There was a problem hiding this comment.
Ok, changed that now. Any reason for this? Is it bad style or does it have any side effects?
Sorry, something went wrong.
There was a problem hiding this comment.
It's just more specific than catching a general error, that might be raised by other bits of code that aren't the specific assertion line you added.
Sorry, something went wrong.
I'd agree, but I don't know how that would be done with Sphinx.
I don't think so because Pillow is not actually a requirement, just an optional thing, which, if present, allows to have further functionality included. |
Sorry, something went wrong.
|
Don‘t know either how it could be done with Sphinx. But since we‘ll rarely change the version dependency, it’s ok to hard code in the docs. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
Document the minimum optional Pillow version.
Fixes #10633.
PR Checklist