parent
2a4b68c222
commit
2c732885c6
1 changed files with 3 additions and 5 deletions
|
|
@ -785,20 +785,18 @@ def input_text(prompt='Enter text'):
|
|||
response = None
|
||||
if prompt[-1:] != ' ':
|
||||
prompt += ' '
|
||||
print(prompt, end='', flush=True)
|
||||
|
||||
while response is None:
|
||||
if os.name == 'posix':
|
||||
# Flush input to (hopefully) avoid EOFError
|
||||
tcflush(sys.stdin, TCIOFLUSH)
|
||||
try:
|
||||
response = input()
|
||||
response = input(prompt)
|
||||
LOG.debug('%s%s', prompt, response)
|
||||
except EOFError:
|
||||
# Ignore and try again
|
||||
#LOG.warning('Exception occured', exc_info=True)
|
||||
#print('', end='', flush=True)
|
||||
pass
|
||||
LOG.warning('Exception occured', exc_info=True)
|
||||
print('', flush=True)
|
||||
|
||||
return response
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue