mirror of
https://github.com/python/cpython.git
synced 2025-10-17 04:08:28 +00:00
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>
This commit is contained in:
parent
9558d22ac3
commit
3185e3115c
15 changed files with 38 additions and 45 deletions
|
@ -2855,8 +2855,7 @@ def no_color():
|
|||
swap_attr(_colorize, "can_colorize", lambda file=None: False),
|
||||
EnvironmentVarGuard() as env,
|
||||
):
|
||||
for var in {"FORCE_COLOR", "NO_COLOR", "PYTHON_COLORS"}:
|
||||
env.unset(var)
|
||||
env.unset("FORCE_COLOR", "NO_COLOR", "PYTHON_COLORS")
|
||||
env.set("NO_COLOR", "1")
|
||||
yield
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue