mirror of
https://github.com/codingo/Interlace.git
synced 2025-12-18 15:24:23 +01:00
Merge pull request #96 from joohoi/fix_95
Fix issue of breaking process when a child process of subprocess closes stdout pipe
This commit is contained in:
@@ -48,8 +48,10 @@ class Task(object):
|
|||||||
|
|
||||||
def _run_task(self, t=False):
|
def _run_task(self, t=False):
|
||||||
if t:
|
if t:
|
||||||
s = subprocess.Popen(self.task, shell=True, stdout=subprocess.PIPE)
|
s = subprocess.Popen(self.task, shell=True,
|
||||||
out = s.stdout.readline().decode("utf-8")
|
stdout=subprocess.PIPE,
|
||||||
|
encoding="utf-8")
|
||||||
|
out, _ = s.communicate()
|
||||||
if out != "":
|
if out != "":
|
||||||
t.write(out)
|
t.write(out)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user