mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-06 09:20:57 +01:00
Merge pull request #2725 from xonsh/blockout
CommandPipeline.output is now fully non-blocking
This commit is contained in:
commit
d5393a5e92
2 changed files with 21 additions and 3 deletions
14
news/blockout.rst
Normal file
14
news/blockout.rst
Normal 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
|
|
@ -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):
|
||||
|
|
Loading…
Add table
Reference in a new issue