]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-139862: Remove `color` from HelpFormatter (#142274)
authorSavannah Ostrowski <savannah@python.org>
Fri, 5 Dec 2025 16:21:31 +0000 (08:21 -0800)
committerGitHub <noreply@github.com>
Fri, 5 Dec 2025 16:21:31 +0000 (16:21 +0000)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Lib/argparse.py
Misc/NEWS.d/next/Library/2025-12-04-23-24-24.gh-issue-139862.NBfsD4.rst [new file with mode: 0644]

index 55ecdadd8c93989f7493b9ae2aa33fe4d246fbac..41467707d393c07a988c1628ef8898bb78e1ce48 100644 (file)
@@ -166,7 +166,6 @@ class HelpFormatter(object):
         indent_increment=2,
         max_help_position=24,
         width=None,
-        color=True,
     ):
         # default setting for width
         if width is None:
@@ -174,7 +173,6 @@ class HelpFormatter(object):
             width = shutil.get_terminal_size().columns
             width -= 2
 
-        self._set_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-12-04-23-24-24.gh-issue-139862.NBfsD4.rst b/Misc/NEWS.d/next/Library/2025-12-04-23-24-24.gh-issue-139862.NBfsD4.rst
new file mode 100644 (file)
index 0000000..2bee888
--- /dev/null
@@ -0,0 +1 @@
+Remove ``color`` parameter from :class:`!argparse.HelpFormatter` constructor. Color is controlled by :class:`~argparse.ArgumentParser`.