1
from __future__ import print_function
6
from click.tests import config
9
def _append_env_path(envname, value):
10
if envname in os.environ:
11
if value in os.environ[envname].split(":"):
13
os.environ[envname] = "%s:%s" % (os.environ[envname], value)
15
os.environ[envname] = value
19
# Don't do any of this in interactive mode.
20
if not hasattr(sys, "ps1"):
21
_lib_click_dir = os.path.join(config.abs_top_builddir, "lib", "click")
24
"LD_LIBRARY_PATH", os.path.join(_lib_click_dir, ".libs")):
26
if _append_env_path("GI_TYPELIB_PATH", _lib_click_dir):
29
# We have to re-exec ourselves to get the dynamic loader to pick up
30
# the new value of LD_LIBRARY_PATH.
31
if "-m unittest" in sys.argv[0]:
32
# unittest does horrible things to sys.argv in the name of
33
# "usefulness", making the re-exec more painful than it needs to
36
sys.executable, [sys.executable, "-m", "unittest"] + sys.argv[1:])
38
os.execvp(sys.executable, [sys.executable] + sys.argv)