Determine if an environment variable is under our control.
(n)
| 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()))'], |
nothing calls this directly
no test coverage detected