Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TEE return code for pipeline is wrong when non-last command fails #660

Closed
vient opened this issue Oct 31, 2023 · 0 comments · Fixed by #661
Closed

TEE return code for pipeline is wrong when non-last command fails #660

vient opened this issue Oct 31, 2023 · 0 comments · Fixed by #661

Comments

@vient
Copy link
Contributor

vient commented Oct 31, 2023

Based on #145

from plumbum.cmd import yes, head
from plumbum import TEE, RETCODE

chain = yes['-x'] | head
print(chain & RETCODE)  # prints 1
with chain.bgrun(retcode=None) as p:
    print(p.run()[0])   # prints 1
print((chain & TEE(retcode=None))[0])  # prints 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant