diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index 1a58f6f8..c5c0db78 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -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):