CommandPipeline.output is now fully non-blocking

This commit is contained in:
Anthony Scopatz 2018-07-17 11:39:16 -04:00
parent 368a13d9d6
commit c37e023a7c
2 changed files with 21 additions and 3 deletions

14
news/blockout.rst Normal file
View file

@ -0,0 +1,14 @@
**Added:** None
**Changed:** None
**Deprecated:** None
**Removed:** None
**Fixed:**
* ``CommandPipeline.output`` now does properly lazy, non-blocking creation of
output string. ``CommandPipeline.out`` remains blocking.
**Security:** None

View file

@ -2181,9 +2181,13 @@ class CommandPipeline:
@property
def output(self):
if self._output is None:
self._output = ''.join(self.lines)
return self._output
"""Non-blocking, lazy access to output"""
if self.ended:
if self._output is None:
self._output = ''.join(self.lines)
return self._output
else:
return ''.join(self.lines)
@property
def out(self):