Skip to content

Commit

Permalink
Ignore modules with syntax errors in them
Browse files Browse the repository at this point in the history
  • Loading branch information
stijn-uva committed Feb 15, 2022
1 parent 8b536de commit c8447a7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions common/lib/module_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,14 @@ def load_modules(self):
# try importing
try:
module = importlib.import_module(module_name)
except ImportError as e:
except (SyntaxError, ImportError) as e:
# this is fine, just ignore this data source and give a heads up
self.ignore.append(module_name)
if e.name not in self.missing_modules:
self.missing_modules[e.name] = [module_name]
key_name = e.name if hasattr(e, "name") else module_name
if key_name not in self.missing_modules:
self.missing_modules[key_name] = [module_name]
else:
self.missing_modules[e.name].append(module_name)
self.missing_modules[key_name].append(module_name)
continue

# see if module contains the right type of content by looping
Expand Down

0 comments on commit c8447a7

Please sign in to comment.