File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -92,11 +92,12 @@ def run_analyzer(analyzer: str) -> None:
9292 )
9393 loader = importlib .machinery .SourceFileLoader ("__main__" , analyzer )
9494 spec = importlib .util .spec_from_loader (loader .name , loader )
95- if spec :
96- analyzer_module = importlib .util .module_from_spec (spec )
97- # Expose package information to dynamically-imported module
98- analyzer_module .__package__ = __package__
99- loader .exec_module (analyzer_module )
95+ if not spec :
96+ raise ImportError (f"Could not create a module spec for { analyzer } " )
97+ analyzer_module = importlib .util .module_from_spec (spec )
98+ # Expose package information to dynamically-imported module
99+ analyzer_module .__package__ = __package__
100+ loader .exec_module (analyzer_module )
100101
101102
102103def main () -> None :
You can’t perform that action at this time.
0 commit comments