From 23a88401b7e1f092d5fcf1c59cda03218ac7fef9 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Tue, 8 Jan 2019 15:11:34 -0700 Subject: [PATCH] Avoid rare crash --- .bin/Scripts/functions/common.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.bin/Scripts/functions/common.py b/.bin/Scripts/functions/common.py index f5f3cb77..d64e2e9f 100644 --- a/.bin/Scripts/functions/common.py +++ b/.bin/Scripts/functions/common.py @@ -102,7 +102,12 @@ def ask(prompt='Kotaero!'): answer = None prompt = '{} [Y/N]: '.format(prompt) while answer is None: - tmp = input(prompt) + try: + tmp = input(prompt) + except EOFError: + # Just try again? + sleep(1) + tmp = input(prompt) if re.search(r'^y(es|)$', tmp, re.IGNORECASE): answer = True elif re.search(r'^n(o|ope|)$', tmp, re.IGNORECASE): @@ -412,7 +417,12 @@ def non_clobber_rename(full_path): def pause(prompt='Press Enter to continue... '): """Simple pause implementation.""" - input(prompt) + try: + input(prompt) + except EOFError: + # Just try again? + sleep(1) + input(prompt) def ping(addr='google.com'):