1
0
mirror of https://github.com/home-assistant/core.git synced 2026-06-01 13:14:35 +01:00
Files
core/homeassistant/util/environment.py
T
2015-07-15 18:37:24 -07:00

10 lines
267 B
Python

""" 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'))