mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-26 17:24: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:
|
||||
__import__(module)
|
||||
return True
|
||||
except ImportError:
|
||||
except ModuleNotFoundError:
|
||||
return False
|
||||
except ImportError as ex:
|
||||
warnings.warn(str(ex))
|
||||
return False
|
||||
|
||||
|
||||
|
@ -145,7 +148,10 @@ def check_feature(feature):
|
|||
try:
|
||||
imported_module = __import__(module, fromlist=["PIL"])
|
||||
return getattr(imported_module, flag)
|
||||
except ImportError:
|
||||
except ModuleNotFoundError:
|
||||
return None
|
||||
except ImportError as ex:
|
||||
warnings.warn(str(ex))
|
||||
return None
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user