Skip to content
Merged
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
10 changes: 8 additions & 2 deletions src/ducktools/pythonfinder/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class FixedArgumentParser(_laz.argparse.ArgumentParser): # type: ignore
This prevents the unnecessary import.
"""

def _get_formatter(self):
def _get_formatter(self, file=None, *args, **kwargs):
# Calculate width
try:
columns = int(os.environ['COLUMNS'])
Expand All @@ -110,7 +110,13 @@ def _get_formatter(self):
columns = size.columns

# noinspection PyArgumentList
return self.formatter_class(prog=self.prog, width=columns - 2)
formatter = self.formatter_class(prog=self.prog, width=columns - 2)
if sys.version_info >= (3, 15): #
formatter._set_color(self.color, file=file)
elif sys.version_info >= (3, 14):
formatter._set_color(self.color)

return formatter

return FixedArgumentParser

Expand Down
4 changes: 2 additions & 2 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.