if 'stdout' not in kwargs:
kwargs['stdout'] = subprocess.PIPE
if 'stderr' not in kwargs:
- kwargs['stderr'] = subprocess.STDOUT
+ kwargs['stderr'] = subprocess.PIPE
p = subprocess.Popen(popen_args, *args, **kwargs)
- out, _ = p.communicate(stdin_str)
+ out, err = p.communicate(stdin_str)
if p.returncode:
- raise subprocess.CalledProcessError(p.returncode, popen_args, out)
+ raise subprocess.CalledProcessError(p.returncode, '%s, stdout: %s, stderr: %s' %
+ (popen_args, out, err))
return out
#