From c083a124ad1101b29d640f7ce8aa08e063ba5080 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Thu, 26 Dec 2019 17:00:41 -0700 Subject: [PATCH] Adjusted wk.std.input_text() again * Dropped tcflush usage for simplicity * Readded the prompt usage from 564745f03bf96a4fcbcc32bbfda6b255f70e0663 --- scripts/wk/std.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/scripts/wk/std.py b/scripts/wk/std.py index f8254ea0..88d70d25 100644 --- a/scripts/wk/std.py +++ b/scripts/wk/std.py @@ -19,13 +19,6 @@ from collections import OrderedDict import requests -try: - from termios import tcflush, TCIOFLUSH -except ImportError: - if os.name == 'posix': - # Not worried about this under Windows - raise - from wk.cfg.main import ( ENABLED_UPLOAD_DATA, INDENT, @@ -820,13 +813,11 @@ 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(prompt) + response = input() LOG.debug('%s%s', prompt, response) except EOFError: # Ignore and try again