diff options
author | Bénédikt Tran <10796600+picnixz@users.noreply.github.com> | 2025-03-16 13:09:33 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-16 13:09:33 (GMT) |
commit | 3185e3115c918ec189e16cf9f5b51a13a0146556 (patch) | |
tree | 4a773847ee275359ae58832afea1071858e539af /Lib/test/test__osx_support.py | |
parent | 9558d22ac308c102e4f843541eead2022050225e (diff) | |
download | cpython-3185e3115c918ec189e16cf9f5b51a13a0146556.zip cpython-3185e3115c918ec189e16cf9f5b51a13a0146556.tar.gz cpython-3185e3115c918ec189e16cf9f5b51a13a0146556.tar.bz2 |
gh-131277: allow `EnvironmentVarGuard` to unset more than one environment variable at once (#131280)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Diffstat (limited to 'Lib/test/test__osx_support.py')
-rw-r--r-- | Lib/test/test__osx_support.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Lib/test/test__osx_support.py b/Lib/test/test__osx_support.py index 4a14cb3..53aa266 100644 --- a/Lib/test/test__osx_support.py +++ b/Lib/test/test__osx_support.py @@ -20,12 +20,13 @@ class Test_OSXSupport(unittest.TestCase): self.prog_name = 'bogus_program_xxxx' self.temp_path_dir = os.path.abspath(os.getcwd()) self.env = self.enterContext(os_helper.EnvironmentVarGuard()) - for cv in ('CFLAGS', 'LDFLAGS', 'CPPFLAGS', - 'BASECFLAGS', 'BLDSHARED', 'LDSHARED', 'CC', - 'CXX', 'PY_CFLAGS', 'PY_LDFLAGS', 'PY_CPPFLAGS', - 'PY_CORE_CFLAGS', 'PY_CORE_LDFLAGS'): - if cv in self.env: - self.env.unset(cv) + + self.env.unset( + 'CFLAGS', 'LDFLAGS', 'CPPFLAGS', + 'BASECFLAGS', 'BLDSHARED', 'LDSHARED', 'CC', + 'CXX', 'PY_CFLAGS', 'PY_LDFLAGS', 'PY_CPPFLAGS', + 'PY_CORE_CFLAGS', 'PY_CORE_LDFLAGS' + ) def add_expected_saved_initial_values(self, config_vars, expected_vars): # Ensure that the initial values for all modified config vars |