Skip to content

Commit 8b39663

Browse files
committed
yield remaining
1 parent df9784a commit 8b39663

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

taskbadger/process.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ def run(self):
3434
else:
3535
yield
3636

37+
if self.capture_output and (stdout or stderr):
38+
yield {"stdout": stdout.read(), "stderr": stderr.read()}
39+
3740
self.returncode = process.returncode
3841

3942

@@ -67,6 +70,9 @@ def read(self):
6770
self._lock.release()
6871
return outdata
6972

73+
def __bool__(self):
74+
return bool(self.data)
75+
7076

7177
def _should_update(last_update: datetime, update_frequency_seconds):
7278
return (datetime.utcnow() - last_update).total_seconds() >= update_frequency_seconds

0 commit comments

Comments
 (0)