Skip to content

Commit e4f54d4

Browse files
gpsheadclaude
andcommitted
Remove redundant no_color() context manager
The functionality is already provided by force_color(False) and force_not_colorized() which were added since this branch started. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent a0656ce commit e4f54d4

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

Lib/test/support/__init__.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2939,21 +2939,6 @@ def new_setUpClass(cls):
29392939
return cls
29402940

29412941

2942-
@contextlib.contextmanager
2943-
def no_color():
2944-
"""Force the terminal to not be colorized."""
2945-
import _colorize
2946-
from .os_helper import EnvironmentVarGuard
2947-
2948-
with (
2949-
swap_attr(_colorize, "can_colorize", lambda file=None: False),
2950-
EnvironmentVarGuard() as env,
2951-
):
2952-
env.unset("FORCE_COLOR", "NO_COLOR", "PYTHON_COLORS")
2953-
env.set("NO_COLOR", "1")
2954-
yield
2955-
2956-
29572942
@contextlib.contextmanager
29582943
def force_color(color: bool):
29592944
import _colorize

0 commit comments

Comments
 (0)