Skip to content
Closed
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
13 changes: 7 additions & 6 deletions httpie/cli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,13 @@ def load(self) -> T:

@property
def help(self) -> str:
# Avoid calling getter during parser initialization in Python 3.14+
# Only format help when it's actually needed (not during parser init)
if self._help is None and self.help_formatter is not None:
self._help = self.help_formatter(
self.load(),
isolation_mode=self.isolation_mode
)
return self._help
# During parser initialization, we don't want to call the getter yet
# Return a placeholder to satisfy argparse requirements
self._help = ""
return self._help if self._help is not None else ""

@help.setter
def help(self, value: Any) -> None:
Expand All @@ -76,4 +77,4 @@ def __iter__(self) -> Iterator[T]:
return iter(self.load())

def __call__(self, parser, namespace, values, option_string=None):
setattr(namespace, self.dest, values)
setattr(namespace, self.dest, values)
Loading