hass-core/homeassistant/util/environment.py
2016-01-27 00:08:06 +01:00

13 lines
331 B
Python

"""
homeassistant.util.environement
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Environement helpers.
"""
import sys
def is_virtual():
""" Return if we run in a virtual environtment. """
# Check supports venv && virtualenv
return (getattr(sys, 'base_prefix', sys.prefix) != sys.prefix or
hasattr(sys, 'real_prefix'))