Avoid rare crash
This commit is contained in:
parent
1e5f72f79a
commit
23a88401b7
1 changed files with 12 additions and 2 deletions
|
|
@ -102,6 +102,11 @@ def ask(prompt='Kotaero!'):
|
||||||
answer = None
|
answer = None
|
||||||
prompt = '{} [Y/N]: '.format(prompt)
|
prompt = '{} [Y/N]: '.format(prompt)
|
||||||
while answer is None:
|
while answer is None:
|
||||||
|
try:
|
||||||
|
tmp = input(prompt)
|
||||||
|
except EOFError:
|
||||||
|
# Just try again?
|
||||||
|
sleep(1)
|
||||||
tmp = input(prompt)
|
tmp = input(prompt)
|
||||||
if re.search(r'^y(es|)$', tmp, re.IGNORECASE):
|
if re.search(r'^y(es|)$', tmp, re.IGNORECASE):
|
||||||
answer = True
|
answer = True
|
||||||
|
|
@ -412,6 +417,11 @@ def non_clobber_rename(full_path):
|
||||||
|
|
||||||
def pause(prompt='Press Enter to continue... '):
|
def pause(prompt='Press Enter to continue... '):
|
||||||
"""Simple pause implementation."""
|
"""Simple pause implementation."""
|
||||||
|
try:
|
||||||
|
input(prompt)
|
||||||
|
except EOFError:
|
||||||
|
# Just try again?
|
||||||
|
sleep(1)
|
||||||
input(prompt)
|
input(prompt)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue