acatton / python-spm

:muscle: Simple and secure sub processes manager
https://python-spm.readthedocs.org/en/latest/
MIT License
10 stars 3 forks source link

No way to get exist statuses of intermediate commands #5

Closed gavinwahl closed 9 years ago

gavinwahl commented 9 years ago

The returncode of a pipeline is the return code of the last command. There's no way to find out if a command in the middle failed.

>>> proc = run('ls', 'nonexistent').pipe('cat')
>>> proc.wait()
ls: cannot access nonexistent: No such file or directory
('', None)
>>> proc.returncode
0
acatton commented 9 years ago

The wait() programming interface needs to be redesigned. I want it to raise a CalledProcessError when it fails.