Fix check for running inside venv (#8481)

* Import and use the function from pip instead of defining it
  ourselves.
* Fix tests.
This commit is contained in:
Martin Hjelmare
2017-07-15 16:25:02 +02:00
committed by Paulus Schoutsen
parent 6ca828fd14
commit 543e8bb62e
5 changed files with 36 additions and 24 deletions

View File

@@ -77,7 +77,7 @@ def _async_process_requirements(hass: core.HomeAssistant, name: str,
def pip_install(mod):
"""Install packages."""
if pkg_util.is_virtual_env():
if pkg_util.running_under_virtualenv():
return pkg_util.install_package(
mod, constraints=os.path.join(
os.path.dirname(__file__), CONSTRAINT_FILE))