Closed gavinwahl closed 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
The wait() programming interface needs to be redesigned. I want it to raise a CalledProcessError when it fails.
wait()
CalledProcessError
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.