From f78c1fc4a3f72e7ff38d251b6f8f178bef7b3422 Mon Sep 17 00:00:00 2001 From: Ian Costanzo Date: Tue, 9 Jul 2019 15:58:15 -0700 Subject: [PATCH] Swallow empty input in demo scripts Signed-off-by: Ian Costanzo --- demo/utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/demo/utils.py b/demo/utils.py index e674deee41..b45efcced6 100644 --- a/demo/utils.py +++ b/demo/utils.py @@ -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