mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-27 09:44:31 +03:00
warn if module is found but fails to import in PIL.features
This commit is contained in:
parent
e971674011
commit
3d4e9b107d
|
@ -33,7 +33,10 @@ def check_module(feature):
|
||||||
try:
|
try:
|
||||||
__import__(module)
|
__import__(module)
|
||||||
return True
|
return True
|
||||||
except ImportError:
|
except ModuleNotFoundError:
|
||||||
|
return False
|
||||||
|
except ImportError as ex:
|
||||||
|
warnings.warn(str(ex))
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
@ -145,7 +148,10 @@ def check_feature(feature):
|
||||||
try:
|
try:
|
||||||
imported_module = __import__(module, fromlist=["PIL"])
|
imported_module = __import__(module, fromlist=["PIL"])
|
||||||
return getattr(imported_module, flag)
|
return getattr(imported_module, flag)
|
||||||
except ImportError:
|
except ModuleNotFoundError:
|
||||||
|
return None
|
||||||
|
except ImportError as ex:
|
||||||
|
warnings.warn(str(ex))
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user