diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2023-01-27 18:50:27 -0500 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2023-01-27 19:24:27 -0500 |
commit | 694718a970fb5af1fde5f2f60eb4bf1845c9b747 (patch) | |
tree | ff482022db2c6db54056ff9325e14c4e5f2f436b | |
parent | 50b5aa7523c1b12fa038c8bfb4b68efe680a63c7 (diff) | |
download | cmd2-git-694718a970fb5af1fde5f2f60eb4bf1845c9b747.tar.gz |
Fixed mypy and flake8 errors.
-rw-r--r-- | cmd2/argparse_custom.py | 2 | ||||
-rw-r--r-- | cmd2/cmd2.py | 6 | ||||
-rw-r--r-- | setup.cfg | 2 |
3 files changed, 6 insertions, 4 deletions
diff --git a/cmd2/argparse_custom.py b/cmd2/argparse_custom.py index fea6d9cd..a8ad1ebd 100644 --- a/cmd2/argparse_custom.py +++ b/cmd2/argparse_custom.py @@ -276,7 +276,7 @@ try: runtime_checkable, ) except ImportError: - from typing_extensions import ( # type: ignore[misc] + from typing_extensions import ( # type: ignore[assignment] Protocol, runtime_checkable, ) diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index 417d45c3..6cd8b950 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -2431,7 +2431,8 @@ class Cmd(cmd.Cmd): if raise_keyboard_interrupt and not stop: raise ex except SystemExit as ex: - self.exit_code = ex.code + if isinstance(ex.code, int): + self.exit_code = ex.code stop = True except PassThroughException as ex: raise ex.wrapped_ex @@ -2444,7 +2445,8 @@ class Cmd(cmd.Cmd): if raise_keyboard_interrupt and not stop: raise ex except SystemExit as ex: - self.exit_code = ex.code + if isinstance(ex.code, int): + self.exit_code = ex.code stop = True except PassThroughException as ex: raise ex.wrapped_ex @@ -9,7 +9,7 @@ addopts = [flake8] count = True -ignore = E203,E231,W503 # E231 can be removed once black is fixed. +ignore = E203,W503 max-complexity = 26 max-line-length = 127 show-source = True |