File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -148,11 +148,10 @@ def check_feature(feature: str) -> bool | None:
148148
149149 try :
150150 imported_module = __import__ (module , fromlist = ["PIL" ])
151- if isinstance (flag , str ):
152- return getattr (imported_module , flag )
153- else :
151+ if isinstance (flag , bool ):
154152 _deprecate .deprecate (f'check_feature("{ feature } ")' , 12 )
155153 return flag
154+ return getattr (imported_module , flag )
156155 except ModuleNotFoundError :
157156 return None
158157 except ImportError as ex :
Original file line number Diff line number Diff line change 1414 * versions, before enabling animation support.
1515 */
1616#if WEBP_MUX_ABI_VERSION < 0x0106 || WEBP_DEMUX_ABI_VERSION < 0x0107
17- #error libwebp 0.5.0 and above is required. Upgrade libwebp or build with --disable-webp flag
17+ #error libwebp 0.5.0 and above is required. Upgrade libwebp or build Pillow with --disable-webp flag
1818#endif
1919
2020void
@@ -784,13 +784,13 @@ static PyMethodDef webpMethods[] = {
784784
785785static int
786786setup_module (PyObject * m ) {
787- PyObject * d = PyModule_GetDict (m );
788787 /* Ready object types */
789788 if (PyType_Ready (& WebPAnimDecoder_Type ) < 0 ||
790789 PyType_Ready (& WebPAnimEncoder_Type ) < 0 ) {
791790 return -1 ;
792791 }
793792
793+ PyObject * d = PyModule_GetDict (m );
794794 PyObject * v = PyUnicode_FromString (WebPDecoderVersion_str ());
795795 PyDict_SetItemString (d , "webpdecoder_version" , v ? v : Py_None );
796796 Py_XDECREF (v );
You can’t perform that action at this time.
0 commit comments