Skip to content

Commit

Permalink
Dev: utils: Add parentheses to if else statements
Browse files Browse the repository at this point in the history
Avoid get empty options in else case
  • Loading branch information
liangxin1300 committed Feb 14, 2025
1 parent 61bdb39 commit 033a45c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crmsh/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def ask(msg, background_wait=True, cancel_option=False):
if not can_ask(background_wait):
return False

option_str = "y/n" + "/c" if cancel_option else ""
option_str = "y/n" + ("/c" if cancel_option else "")
msg += ' '
if msg.endswith('? '):
msg = msg[:-2] + f' ({option_str})? '
Expand Down

0 comments on commit 033a45c

Please sign in to comment.