Skip to content

Commit 3c5f8de

Browse files
committed
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 ```
1 parent 7db5f11 commit 3c5f8de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmd2/argparse_custom.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1361,7 +1361,7 @@ def format_help(self) -> str:
13611361
# determine help from format above
13621362
return formatter.format_help() + '\n'
13631363

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

0 commit comments

Comments
 (0)