Skip to content

Commit 0e7329c

Browse files
committed
Always forward environment variables needed for scripts
Previously these were only forwarded when running tests.
1 parent 9522eb4 commit 0e7329c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

python/lsst/sconsUtils/state.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,13 @@ def _initEnvironment():
426426
#
427427
env["eupsFlavor"] = eupsForScons.flavor()
428428

429+
# Forward environment variables that should always be set to allow
430+
# our code to run even outside of tests. Executables would normally
431+
# pick up the linker environment variables via libraryLoaderEnvironment().
432+
for envvar in ["PYTHONPATH", "HTTP_PROXY", "HTTPS_PROXY"]:
433+
if envvar in os.environ:
434+
env.AppendENVPath(envvar, os.environ[envvar])
435+
429436

430437
_configured = False
431438

python/lsst/sconsUtils/tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ def __init__(
9494
"astropy due to lack of astropy directory within it"
9595
)
9696

97-
# Forward some environment to the tests
98-
for envvar in ["PYTHONPATH", "HTTP_PROXY", "HTTPS_PROXY", xdgCacheVar]:
97+
# Forward additional environment to the tests.
98+
for envvar in [xdgCacheVar]:
9999
if envvar in os.environ:
100100
env.AppendENVPath(envvar, os.environ[envvar])
101101

0 commit comments

Comments
 (0)