diff --git a/core/interact/interact.py b/core/interact/interact.py index 4fe36b6..bfb2536 100644 --- a/core/interact/interact.py +++ b/core/interact/interact.py @@ -377,8 +377,10 @@ class InteractBase(object): break if time.time() - t > max_time_sec: break - p.terminate() - sys.stdin = os.fdopen( sys.stdin.fileno() ) + p.terminate() + old_stdin = sys.stdin + sys.stdin = os.fdopen( os.dup(sys.stdin.fileno()) ) + old_stdin.close() return inp def input_process_skip_pending(self, stdin_fd):