Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Lib/argparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def __init__(
width = shutil.get_terminal_size().columns
width -= 2

self._set_color(color)
self._color = color
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand where is this used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review!
You're right — after checking the code path again, this self._color assignment is not actually used anywhere before _get_formatter() runs. I will check and i will report if i found the real issue

self._prog = prog
self._indent_increment = indent_increment
self._max_help_position = min(max_help_position,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Avoid redundant color initialization in argparse.HelpFormatter. Patch by Chilla Kalyan.
Loading