Commit cd3c53a9 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

BF: Popen objects not thread safe? Occasionally getting bad return

code. Forward stream func just uses '' to detect EOF/end process, simpler
this way anyway
parent 0cda1155
......@@ -911,9 +911,8 @@ class Process(object):
if streamname == 'stdout': stream = popen.stdout
else: stream = popen.stderr
while popen.returncode is None:
while True:
line = stream.readline().decode('utf-8')
popen.poll()
if line == '':
break
else:
......@@ -921,14 +920,6 @@ class Process(object):
if log_output:
log.debug(' [%s]: %s', streamname, line.rstrip())
# process finished, flush the stream
line = stream.readline().decode('utf-8')
while line != '':
queue.put(line)
if log_output:
log.debug(' [%s]: %s', streamname, line.rstrip())
line = stream.readline().decode('utf-8')
@staticmethod
def popen(cmd, admin=False, ctx=None, **kwargs):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment