Skip to content

Commit

Permalink
Temporarily ignore error for Issue #1281 (#1283)
Browse files Browse the repository at this point in the history
  • Loading branch information
anselor authored Dec 11, 2023
1 parent 8d88c35 commit d4c02a8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmd2/cmd2.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,14 +684,19 @@ def _build_parser(
self,
parent: CommandParent,
parser_builder: Optional[
Union[argparse.ArgumentParser, Callable[[], argparse.ArgumentParser], StaticArgParseBuilder, ClassArgParseBuilder]
Union[
argparse.ArgumentParser,
Callable[[], argparse.ArgumentParser],
StaticArgParseBuilder,
ClassArgParseBuilder,
]
],
) -> Optional[argparse.ArgumentParser]:
parser: Optional[argparse.ArgumentParser] = None
if isinstance(parser_builder, staticmethod):
parser = parser_builder.__func__()
elif isinstance(parser_builder, classmethod):
parser = parser_builder.__func__(parent if not None else self)
parser = parser_builder.__func__(parent if not None else self) # type: ignore[arg-type]
elif callable(parser_builder):
parser = parser_builder()
elif isinstance(parser_builder, argparse.ArgumentParser):
Expand Down

0 comments on commit d4c02a8

Please sign in to comment.