From 98d3657cbcde7bc5f70a37a9220b1ce5fe9dab04 Mon Sep 17 00:00:00 2001 From: Colombo Date: Sat, 29 Feb 2020 15:00:46 +0400 Subject: [PATCH] _ --- core/interact/interact.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/interact/interact.py b/core/interact/interact.py index 02659c4..eaf0dab 100644 --- a/core/interact/interact.py +++ b/core/interact/interact.py @@ -366,7 +366,11 @@ class InteractBase(object): sq.put (True) except: sq.put (False) - + sq.close() + sq = None + import gc + gc.collect() + def input_in_time (self, str, max_time_sec): sq = multiprocessing.Queue() p = multiprocessing.Process(target=self.input_process, args=( sys.stdin.fileno(), sq, str)) @@ -381,6 +385,7 @@ class InteractBase(object): if time.time() - t > max_time_sec: break p.terminate() + p.join() sq.close() old_stdin = sys.stdin sys.stdin = os.fdopen( os.dup(sys.stdin.fileno()) )