|
|
@ -77,21 +77,25 @@ class WorkerProcess(multiprocessing.Process):
|
|
|
|
self._variable_manager = variable_manager
|
|
|
|
self._variable_manager = variable_manager
|
|
|
|
self._shared_loader_obj = shared_loader_obj
|
|
|
|
self._shared_loader_obj = shared_loader_obj
|
|
|
|
|
|
|
|
|
|
|
|
# dupe stdin, if we have one
|
|
|
|
if sys.stdin.isatty():
|
|
|
|
self._new_stdin = sys.stdin
|
|
|
|
# dupe stdin, if we have one
|
|
|
|
try:
|
|
|
|
self._new_stdin = sys.stdin
|
|
|
|
fileno = sys.stdin.fileno()
|
|
|
|
try:
|
|
|
|
if fileno is not None:
|
|
|
|
fileno = sys.stdin.fileno()
|
|
|
|
try:
|
|
|
|
if fileno is not None:
|
|
|
|
self._new_stdin = os.fdopen(os.dup(fileno))
|
|
|
|
try:
|
|
|
|
except OSError:
|
|
|
|
self._new_stdin = os.fdopen(os.dup(fileno))
|
|
|
|
# couldn't dupe stdin, most likely because it's
|
|
|
|
except OSError:
|
|
|
|
# not a valid file descriptor, so we just rely on
|
|
|
|
# couldn't dupe stdin, most likely because it's
|
|
|
|
# using the one that was passed in
|
|
|
|
# not a valid file descriptor, so we just rely on
|
|
|
|
pass
|
|
|
|
# using the one that was passed in
|
|
|
|
except ValueError:
|
|
|
|
pass
|
|
|
|
# couldn't get stdin's fileno, so we just carry on
|
|
|
|
except (AttributeError, ValueError):
|
|
|
|
pass
|
|
|
|
# couldn't get stdin's fileno, so we just carry on
|
|
|
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
# set to /dev/null
|
|
|
|
|
|
|
|
self._new_stdin = os.devnull
|
|
|
|
|
|
|
|
|
|
|
|
def run(self):
|
|
|
|
def run(self):
|
|
|
|
'''
|
|
|
|
'''
|
|
|
|