Skip to content

Commit bfe2048

Browse files
committed
Raises to returns
1 parent 97b2b75 commit bfe2048

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

bittensor_cli/cli.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3798,11 +3798,11 @@ def stake_remove(
37983798
"Interactive mode cannot be used with hotkey selection options like "
37993799
"--include-hotkeys, --exclude-hotkeys, --all-hotkeys, or --hotkey."
38003800
)
3801-
raise typer.Exit()
3801+
return False
38023802

38033803
if unstake_all and unstake_all_alpha:
38043804
print_error("Cannot specify both unstake-all and unstake-all-alpha.")
3805-
raise typer.Exit()
3805+
return False
38063806

38073807
if not interactive and not unstake_all and not unstake_all_alpha:
38083808
netuid = get_optional_netuid(netuid, all_netuids)
@@ -3811,19 +3811,19 @@ def stake_remove(
38113811
"You have specified hotkeys to include and also the `--all-hotkeys` flag. The flag"
38123812
" should only be used standalone (to use all hotkeys) or with `--exclude-hotkeys`."
38133813
)
3814-
raise typer.Exit()
3814+
return False
38153815

38163816
if include_hotkeys and exclude_hotkeys:
38173817
print_error(
38183818
"You have specified both including and excluding hotkeys options. Select one or the other."
38193819
)
3820-
raise typer.Exit()
3820+
return False
38213821

38223822
if unstake_all and amount:
38233823
print_error(
38243824
"Cannot specify both a specific amount and 'unstake-all'. Choose one or the other."
38253825
)
3826-
raise typer.Exit()
3826+
return False
38273827

38283828
if amount and amount <= 0:
38293829
print_error(f"You entered an incorrect unstake amount: {amount}")
@@ -3891,12 +3891,12 @@ def stake_remove(
38913891
if include_hotkeys:
38923892
if len(include_hotkeys) > 1:
38933893
print_error("Cannot unstake_all from multiple hotkeys at once.")
3894-
raise typer.Exit()
3894+
return False
38953895
elif is_valid_ss58_address(include_hotkeys[0]):
38963896
hotkey_ss58_address = include_hotkeys[0]
38973897
else:
38983898
print_error("Invalid hotkey ss58 address.")
3899-
raise typer.Exit()
3899+
return False
39003900
elif all_hotkeys:
39013901
wallet = self.wallet_ask(
39023902
wallet_name,
@@ -3981,6 +3981,7 @@ def stake_remove(
39813981
"Hotkeys must be a comma-separated list of ss58s or names, e.g., `--include-hotkeys hk1,hk2`.",
39823982
is_ss58=False,
39833983
)
3984+
return False
39843985

39853986
if exclude_hotkeys:
39863987
exclude_hotkeys = parse_to_list(
@@ -3989,6 +3990,7 @@ def stake_remove(
39893990
"Hotkeys must be a comma-separated list of ss58s or names, e.g., `--exclude-hotkeys hk3,hk4`.",
39903991
is_ss58=False,
39913992
)
3993+
return False
39923994

39933995
return self._run_command(
39943996
remove_stake.unstake(

0 commit comments

Comments
 (0)