Skip to content

Commit

Permalink
catch ModuleNotFoundError raised by importlib.util.find_spec
Browse files Browse the repository at this point in the history
  • Loading branch information
fruitschen committed Dec 28, 2023
1 parent a4c5723 commit bb0e242
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion linkcheck/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ def build_linklists(self):
"""Autodiscovery of linkLists"""
for app in apps.get_app_configs():
module_name = f"{app.name}.linklists"
if not importlib.util.find_spec(module_name):
try:
if not importlib.util.find_spec(module_name):
continue
except ModuleNotFoundError:
continue
the_module = importlib.import_module(module_name)
try:
Expand Down

0 comments on commit bb0e242

Please sign in to comment.