parent
06920b2e47
commit
f23bb344aa
1 changed files with 16 additions and 6 deletions
|
@ -507,10 +507,15 @@ class Runner(object):
|
||||||
fileno = None
|
fileno = None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
self._new_stdin = new_stdin
|
||||||
if not new_stdin and fileno is not None:
|
if not new_stdin and fileno is not None:
|
||||||
self._new_stdin = os.fdopen(os.dup(fileno))
|
try:
|
||||||
else:
|
self._new_stdin = os.fdopen(os.dup(fileno))
|
||||||
self._new_stdin = new_stdin
|
except:
|
||||||
|
# couldn't dupe stdin, most likely because it's
|
||||||
|
# not a valid file descriptor, so we just rely on
|
||||||
|
# using the one that was passed in
|
||||||
|
pass
|
||||||
|
|
||||||
exec_rc = self._executor_internal(host, new_stdin)
|
exec_rc = self._executor_internal(host, new_stdin)
|
||||||
if type(exec_rc) != ReturnData:
|
if type(exec_rc) != ReturnData:
|
||||||
|
@ -1094,10 +1099,15 @@ class Runner(object):
|
||||||
|
|
||||||
workers = []
|
workers = []
|
||||||
for i in range(self.forks):
|
for i in range(self.forks):
|
||||||
|
new_stdin = None
|
||||||
if fileno is not None:
|
if fileno is not None:
|
||||||
new_stdin = os.fdopen(os.dup(fileno))
|
try:
|
||||||
else:
|
new_stdin = os.fdopen(os.dup(fileno))
|
||||||
new_stdin = None
|
except:
|
||||||
|
# couldn't dupe stdin, most likely because it's
|
||||||
|
# not a valid file descriptor, so we just rely on
|
||||||
|
# using the one that was passed in
|
||||||
|
pass
|
||||||
prc = multiprocessing.Process(target=_executor_hook,
|
prc = multiprocessing.Process(target=_executor_hook,
|
||||||
args=(job_queue, result_queue, new_stdin))
|
args=(job_queue, result_queue, new_stdin))
|
||||||
prc.start()
|
prc.start()
|
||||||
|
|
Loading…
Reference in a new issue