Skip to content

Commit

Permalink
Update src/PIL/features.py
Browse files Browse the repository at this point in the history
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
  • Loading branch information
homm and radarhere authored Aug 13, 2024
1 parent e28a0f1 commit 41c1047
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/PIL/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,10 @@ def check_feature(feature: str) -> bool | None:

try:
imported_module = __import__(module, fromlist=["PIL"])
if isinstance(flag, str):
return getattr(imported_module, flag)
elif isinstance(flag, bool):
if isinstance(flag, bool):
_deprecate.deprecate(f'check_feature("{feature}")', 12)
return flag
else:
return None
return getattr(imported_module, flag)
except ModuleNotFoundError:
return None
except ImportError as ex:
Expand Down

0 comments on commit 41c1047

Please sign in to comment.