Construct the environment for the shell to run in based on 'env', or the current process's environment if env is None.
(env=None)
| 52 | |
| 53 | |
| 54 | def build_shell_env(env=None): |
| 55 | """ Construct the environment for the shell to run in based on 'env', or the current |
| 56 | process's environment if env is None.""" |
| 57 | if not env: env = os.environ |
| 58 | # Don't inherit PYTHONPATH or LD_LIBRARY_PATH - the shell launch script must set |
| 59 | # these to include dependencies. Copy 'env' to avoid mutating argument or os.environ. |
| 60 | env = dict(env) |
| 61 | if "PYTHONPATH" in env: |
| 62 | del env["PYTHONPATH"] |
| 63 | if "LD_LIBRARY_PATH" in env: |
| 64 | del env["LD_LIBRARY_PATH"] |
| 65 | return env |
| 66 | |
| 67 | |
| 68 | def assert_var_substitution(result): |
no outgoing calls