mirror of
https://github.com/elisspace/core.git
synced 2026-10-08 18:18:33 +00:00
14 lines
331 B
Python
14 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'))
|