2015-07-07 07:00:21 +00:00
|
|
|
""" Environement helpers. """
|
|
|
|
import sys
|
|
|
|
|
|
|
|
|
|
|
|
def is_virtual():
|
|
|
|
""" Return if we run in a virtual environtment. """
|
2015-07-11 07:02:42 +00:00
|
|
|
# Check supports venv && virtualenv
|
2015-07-16 01:37:24 +00:00
|
|
|
return (getattr(sys, 'base_prefix', sys.prefix) != sys.prefix or
|
|
|
|
hasattr(sys, 'real_prefix'))
|