From 3c5f8de37a72670ff27a6209521fb6fbfef4cd1c Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Mon, 17 Feb 2025 16:09:55 -0500 Subject: [PATCH] Suppress mypy warning 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 ``` --- cmd2/argparse_custom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd2/argparse_custom.py b/cmd2/argparse_custom.py index 68249d85..2af230d1 100644 --- a/cmd2/argparse_custom.py +++ b/cmd2/argparse_custom.py @@ -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: