Skip to content

Commit

Permalink
Merge pull request #107 from vpodzime/master-eof
Browse files Browse the repository at this point in the history
Handle EOF in prompts
  • Loading branch information
olehermanse authored Apr 19, 2022
2 parents 5be3e65 + 1cc8f14 commit 0cca636
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cfbs/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ def prompt_user(prompt, choices=None, default=None):

answer = None
while answer is None:
answer = input(prompt)
try:
answer = input(prompt)
except EOFError:
answer = ""

if answer == "":
if default is not None:
answer = default
Expand Down

0 comments on commit 0cca636

Please sign in to comment.