)_
This commit is contained in:
@@ -359,17 +359,12 @@ class InteractBase(object):
|
|||||||
def input_process(self, stdin_fd, sq, str):
|
def input_process(self, stdin_fd, sq, str):
|
||||||
from core import osex
|
from core import osex
|
||||||
osex.linux_ignore_UserWarning()
|
osex.linux_ignore_UserWarning()
|
||||||
|
|
||||||
sys.stdin = os.fdopen(stdin_fd)
|
sys.stdin = os.fdopen(stdin_fd)
|
||||||
try:
|
try:
|
||||||
inp = input (str)
|
inp = input (str)
|
||||||
sq.put (True)
|
sq.put (True)
|
||||||
except:
|
except:
|
||||||
sq.put (False)
|
sq.put (False)
|
||||||
sq.close()
|
|
||||||
sq = None
|
|
||||||
import gc
|
|
||||||
gc.collect()
|
|
||||||
|
|
||||||
def input_in_time (self, str, max_time_sec):
|
def input_in_time (self, str, max_time_sec):
|
||||||
sq = multiprocessing.Queue()
|
sq = multiprocessing.Queue()
|
||||||
@@ -386,7 +381,6 @@ class InteractBase(object):
|
|||||||
break
|
break
|
||||||
p.terminate()
|
p.terminate()
|
||||||
p.join()
|
p.join()
|
||||||
sq.close()
|
|
||||||
old_stdin = sys.stdin
|
old_stdin = sys.stdin
|
||||||
sys.stdin = os.fdopen( os.dup(sys.stdin.fileno()) )
|
sys.stdin = os.fdopen( os.dup(sys.stdin.fileno()) )
|
||||||
old_stdin.close()
|
old_stdin.close()
|
||||||
|
|||||||
+1
-1
@@ -41,4 +41,4 @@ def linux_ignore_UserWarning():
|
|||||||
# /usr/lib/python3.6/multiprocessing/semaphore_tracker.py:143:
|
# /usr/lib/python3.6/multiprocessing/semaphore_tracker.py:143:
|
||||||
# UserWarning: semaphore_tracker: There appear to be 1 leaked semaphores to clean up at shutdown
|
# UserWarning: semaphore_tracker: There appear to be 1 leaked semaphores to clean up at shutdown
|
||||||
import warnings
|
import warnings
|
||||||
warnings.simplefilter(action='ignore', category=UserWarning)
|
warnings.filterwarnings(action='ignore', message='semaphore')
|
||||||
Reference in New Issue
Block a user