Skip to content

Commit

Permalink
Suppress mypy warning
Browse files Browse the repository at this point in the history
Warning is:
```
cmd2/argparse_custom.py: note: In member "_print_message" of class "Cmd2ArgumentParser":
cmd2/argparse_custom.py:1364:44: error: Argument 2 of "_print_message" is incompatible with supertype "ArgumentParser"; supertype defines the argument type as "SupportsWrite[str] | None"  [override]
cmd2/argparse_custom.py:1364:44: note: This violates the Liskov substitution principle
cmd2/argparse_custom.py:1364:44: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
```
  • Loading branch information
tleonhardt committed Feb 17, 2025
1 parent 7db5f11 commit 3c5f8de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd2/argparse_custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -1361,7 +1361,7 @@ def format_help(self) -> str:
# determine help from format above
return formatter.format_help() + '\n'

def _print_message(self, message: str, file: Optional[IO[str]] = None) -> None:
def _print_message(self, message: str, file: Optional[IO[str]] = None) -> None: # type: ignore[override]
# Override _print_message to use style_aware_write() since we use ANSI escape characters to support color
if message:
if file is None:
Expand Down

0 comments on commit 3c5f8de

Please sign in to comment.