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 eae1517 commit eb8e9fc
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 "")

Check warning on line 309 in crmsh/utils.py

View check run for this annotation

Codecov / codecov/patch

crmsh/utils.py#L309

Added line #L309 was not covered by tests
msg += ' '
if msg.endswith('? '):
msg = msg[:-2] + f' ({option_str})? '
Expand Down

0 comments on commit eb8e9fc

Please sign in to comment.