Skip to content

Commit b726c52

Browse files
committed
Fix two errors, one logical and one type
1 parent 169eead commit b726c52

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

cmd2/argparse_completer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ def consume_argument(arg_state: _ArgumentState, arg_token: str) -> None:
357357
action = remaining_positionals.popleft()
358358

359359
# Are we at a subcommand? If so, forward to the matching completer
360-
if action == self._subcommand_action:
360+
if self._subcommand_action is not None and action == self._subcommand_action:
361361
if token in self._subcommand_action.choices:
362362
# Merge self._parent_tokens and consumed_arg_values
363363
parent_tokens = {**self._parent_tokens, **consumed_arg_values}

cmd2/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def __init__(
7474
settable_object: object,
7575
*,
7676
settable_attrib_name: str | None = None,
77-
onchange_cb: Callable[[str, _T, _T], Any] | None = None,
77+
onchange_cb: Callable[[str, Any, Any], Any] | None = None,
7878
choices: Iterable[Any] | None = None,
7979
choices_provider: ChoicesProviderUnbound[CmdOrSet] | None = None,
8080
completer: CompleterUnbound[CmdOrSet] | None = None,

0 commit comments

Comments
 (0)