diff --git a/Lib/argparse.py b/Lib/argparse.py index 6b79747572f48f..aa56d30f395cd3 100644 --- a/Lib/argparse.py +++ b/Lib/argparse.py @@ -174,7 +174,7 @@ def __init__( width = shutil.get_terminal_size().columns width -= 2 - self._set_color(color) + self._color = color self._prog = prog self._indent_increment = indent_increment self._max_help_position = min(max_help_position, diff --git a/Misc/NEWS.d/next/Library/2025-11-16-06-33-31.gh-issue-141571.n2n0BX.rst b/Misc/NEWS.d/next/Library/2025-11-16-06-33-31.gh-issue-141571.n2n0BX.rst new file mode 100644 index 00000000000000..8883607ada8688 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2025-11-16-06-33-31.gh-issue-141571.n2n0BX.rst @@ -0,0 +1 @@ +Avoid redundant color initialization in argparse.HelpFormatter. Patch by Chilla Kalyan.