Skip to content

Commit

Permalink
fix bug detecting wrong module, since we never get import error
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesdelbeke committed Oct 11, 2023
1 parent 332a65a commit ba34f98
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions detect_app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@

def attempt_import(module_name: str) -> Optional[types.ModuleType]:
"""attempt to import a module, return True if it succeeded"""
with contextlib.suppress(ImportError):
importlib.util.find_spec(module_name)
return True
return False
return bool(importlib.util.find_spec(module_name))


apps = []
Expand Down

0 comments on commit ba34f98

Please sign in to comment.