Merge pull request #2725 from xonsh/blockout

CommandPipeline.output is now fully non-blocking
This commit is contained in:
Morten Enemark Lund 2018-07-17 20:01:59 +02:00 committed by GitHub
commit d5393a5e92
Failed to generate hash of commit
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):