Skip to content

Commit

Permalink
Fix choice() default handling (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
fauxpark authored Jul 27, 2021
1 parent 7104f63 commit fe0bb0a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions milc/questions.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def choice(heading, options, *args, default=None, confirm=False, prompt='Please
if not milc.cli.interactive:
return default

if prompt and default:
if prompt and default is not None:
prompt = prompt + ' [%s] ' % (default + 1,)
elif prompt[-1] != ' ':
prompt += ' '
Expand All @@ -182,7 +182,7 @@ def choice(heading, options, *args, default=None, confirm=False, prompt='Please
return answer

# Massage the answer into a valid integer
if answer == '' and default:
if answer == '' and default is not None:
answer = default
else:
try:
Expand Down

0 comments on commit fe0bb0a

Please sign in to comment.