[Dependencies] Added support for partially uninstalled modules.
This commit is contained in:
parent
120220b986
commit
18bf8d9b78
|
|
@ -701,7 +701,8 @@ def check_tool_python(dep, reload=False):
|
||||||
# Try to load the module
|
# Try to load the module
|
||||||
try:
|
try:
|
||||||
mod = importlib.import_module(dep.module_name)
|
mod = importlib.import_module(dep.module_name)
|
||||||
return check_tool_python_version(mod, dep)
|
if mod.__file__ is not None:
|
||||||
|
return check_tool_python_version(mod, dep)
|
||||||
except ModuleNotFoundError:
|
except ModuleNotFoundError:
|
||||||
pass
|
pass
|
||||||
# Not installed, try to download it
|
# Not installed, try to download it
|
||||||
|
|
@ -712,6 +713,9 @@ def check_tool_python(dep, reload=False):
|
||||||
try:
|
try:
|
||||||
importlib.invalidate_caches()
|
importlib.invalidate_caches()
|
||||||
mod = importlib.import_module(dep.module_name)
|
mod = importlib.import_module(dep.module_name)
|
||||||
|
if mod.__file__ is None:
|
||||||
|
logger.error(mod)
|
||||||
|
return None
|
||||||
res = check_tool_python_version(mod, dep)
|
res = check_tool_python_version(mod, dep)
|
||||||
if res is not None and reload:
|
if res is not None and reload:
|
||||||
res = importlib.reload(reload)
|
res = importlib.reload(reload)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue