Fix module import error in validate.py
This commit is contained in:
parent
aa7338bf67
commit
c1ee576db2
1 changed files with 2 additions and 4 deletions
|
|
@ -203,10 +203,8 @@ def prepare_global_scope(code, module):
|
|||
imported_module = importlib.import_module(node.module)
|
||||
for alias in node.names:
|
||||
exec_globals[alias.name] = getattr(imported_module, alias.name)
|
||||
except ModuleNotFoundError as e:
|
||||
raise ModuleNotFoundError(
|
||||
f"Module {node.module} not found. Please install it and try again. Error: {repr(e)}"
|
||||
)
|
||||
except ModuleNotFoundError:
|
||||
raise ModuleNotFoundError(f"Module {node.module} not found. Please install it and try again")
|
||||
return exec_globals
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue