mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-06 21:12:07 -07:00
_
This commit is contained in:
parent
f55a65c304
commit
a21c55cf25
1 changed files with 3 additions and 6 deletions
|
@ -364,12 +364,6 @@ class InteractBase(object):
|
||||||
except:
|
except:
|
||||||
sq.put (False)
|
sq.put (False)
|
||||||
|
|
||||||
outnull_file = open(os.devnull, 'w')
|
|
||||||
os.dup2 ( outnull_file.fileno(), sys.stderr.fileno() )
|
|
||||||
os.dup2 ( outnull_file.fileno(), sys.stdout.fileno() )
|
|
||||||
sys.stderr = outnull_file
|
|
||||||
sys.stdout = outnull_file
|
|
||||||
|
|
||||||
def input_in_time (self, str, max_time_sec):
|
def input_in_time (self, str, max_time_sec):
|
||||||
sq = multiprocessing.Queue()
|
sq = multiprocessing.Queue()
|
||||||
p = multiprocessing.Process(target=self.input_process, args=( sys.stdin.fileno(), sq, str))
|
p = multiprocessing.Process(target=self.input_process, args=( sys.stdin.fileno(), sq, str))
|
||||||
|
@ -383,8 +377,11 @@ class InteractBase(object):
|
||||||
break
|
break
|
||||||
if time.time() - t > max_time_sec:
|
if time.time() - t > max_time_sec:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
print("1")
|
||||||
p.terminate()
|
p.terminate()
|
||||||
p.join()
|
p.join()
|
||||||
|
print("2")
|
||||||
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()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue