MCPcopy Index your code
hub / github.com/RustPython/RustPython / is_env_var_to_ignore

Method is_env_var_to_ignore

Lib/test/test_subprocess.py:829–836  ·  view source on GitHub ↗

Determine if an environment variable is under our control.

(n)

Source from the content-addressed store, hash-verified

827 """Verify that env={} is as empty as possible."""
828
829 def is_env_var_to_ignore(n):
830 """Determine if an environment variable is under our control."""
831 # This excludes some __CF_* and VERSIONER_* keys MacOS insists
832 # on adding even when the environment in exec is empty.
833 # Gentoo sandboxes also force LD_PRELOAD and SANDBOX_* to exist.
834 return ('VERSIONER' in n or '__CF' in n or # MacOS
835 n == 'LD_PRELOAD' or n.startswith('SANDBOX') or # Gentoo
836 n == 'LC_CTYPE') # Locale coercion triggered
837
838 with subprocess.Popen([sys.executable, "-c",
839 'import os; print(list(os.environ.keys()))'],

Callers

nothing calls this directly

Calls 1

startswithMethod · 0.45

Tested by

no test coverage detected