Fix script load module issue (#21763)

* Fix script load depedency

* Revert #21754
This commit is contained in:
Jason Hu authored and Paulus Schoutsen committed 2019-03-07 16:48:14 -08:00
1 parent 2fb978393b
commit 78a806bc5c
2 files changed
+10 -20

No files matched your search

+2 -7
View File
@@ -52,15 +52,10 @@ def run(args: List) -> int:
hass = HomeAssistant(loop)
pkgload = PackageLoadable(hass)
for req in getattr(script, 'REQUIREMENTS', []):
try:
loop.run_until_complete(pkgload.loadable(req))
if loop.run_until_complete(pkgload.loadable(req)):
continue
except ImportError:
pass
returncode = install_package(req, **_pip_kwargs)
if not returncode:
if not install_package(req, **_pip_kwargs):
print('Aborting script, could not install dependency', req)
return 1