Skip to content

Commit

Permalink
Swallow empty input in demo scripts
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Costanzo <[email protected]>
  • Loading branch information
ianco committed Jul 9, 2019
1 parent e541066 commit f78c1fc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion demo/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,11 @@ async def prompt(*args, **kwargs):
prompt_init()
with patch_stdout():
try:
return await prompt_toolkit.prompt(*args, async_=True, **kwargs)
while True:
tmp = await prompt_toolkit.prompt(*args, async_=True, **kwargs)
if 0 < len(tmp):
break
return tmp
except EOFError:
return None

Expand Down

0 comments on commit f78c1fc

Please sign in to comment.