mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
more piping fixes for multiple commands
This commit is contained in:
parent
3a724d93f3
commit
400ef828d9
3 changed files with 9 additions and 1 deletions
|
@ -52,5 +52,6 @@
|
|||
if previous commands have executed successfully. This is helpful
|
||||
for pipelines where the last command takes a long time to start up,
|
||||
such as GNU Parallel. This also checks to make sure that output has occured.
|
||||
This includes piping 2+ commands together.
|
||||
|
||||
**Security:** None
|
||||
|
|
|
@ -139,6 +139,13 @@ with open('tttt', 'w') as fp:
|
|||
|
||||
![cat tttt | wc]
|
||||
""", ' 1 2 10\n' if ON_WINDOWS else " 1 2 9 <stdin>\n", 0),
|
||||
# test double piping 'real' command
|
||||
("""
|
||||
with open('tttt', 'w') as fp:
|
||||
fp.write("Wow mom!\\n")
|
||||
|
||||
![cat tttt | wc | wc]
|
||||
""", ' 1 4 24\n' if ON_WINDOWS else " 1 4 16 <stdin>\n", 0),
|
||||
]
|
||||
|
||||
|
||||
|
|
|
@ -1513,7 +1513,7 @@ class CommandPipeline:
|
|||
elif prev_end_time is None:
|
||||
# or see if we already know that the next-to-last
|
||||
# proc in teh pipeline has ended.
|
||||
if self.procs[-2].poll() is not None:
|
||||
if self._prev_procs_done():
|
||||
# if it has, record the time
|
||||
prev_end_time = time.time()
|
||||
elif time.time() - prev_end_time >= 0.1:
|
||||
|
|
Loading…
Add table
Reference in a new issue