Skip to content

Commit 694718a

Browse files
committed
Fixed mypy and flake8 errors.
1 parent 50b5aa7 commit 694718a

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

cmd2/argparse_custom.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def my_completer(self, text, line, begidx, endidx, arg_tokens)
276276
runtime_checkable,
277277
)
278278
except ImportError:
279-
from typing_extensions import ( # type: ignore[misc]
279+
from typing_extensions import ( # type: ignore[assignment]
280280
Protocol,
281281
runtime_checkable,
282282
)

cmd2/cmd2.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -2431,7 +2431,8 @@ def onecmd_plus_hooks(
24312431
if raise_keyboard_interrupt and not stop:
24322432
raise ex
24332433
except SystemExit as ex:
2434-
self.exit_code = ex.code
2434+
if isinstance(ex.code, int):
2435+
self.exit_code = ex.code
24352436
stop = True
24362437
except PassThroughException as ex:
24372438
raise ex.wrapped_ex
@@ -2444,7 +2445,8 @@ def onecmd_plus_hooks(
24442445
if raise_keyboard_interrupt and not stop:
24452446
raise ex
24462447
except SystemExit as ex:
2447-
self.exit_code = ex.code
2448+
if isinstance(ex.code, int):
2449+
self.exit_code = ex.code
24482450
stop = True
24492451
except PassThroughException as ex:
24502452
raise ex.wrapped_ex

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ addopts =
99

1010
[flake8]
1111
count = True
12-
ignore = E203,E231,W503 # E231 can be removed once black is fixed.
12+
ignore = E203,W503
1313
max-complexity = 26
1414
max-line-length = 127
1515
show-source = True

0 commit comments

Comments
 (0)