mirror of
https://github.com/beetbox/beets.git
synced 2025-12-14 12:35:19 +01:00
add stderr to exception raised by command_output
This commit is contained in:
parent
26ec2b8d2b
commit
a06c278a20
1 changed files with 7 additions and 6 deletions
|
|
@ -633,13 +633,14 @@ def command_output(cmd, shell=False):
|
|||
Python 2.6 and which can have problems if lots of output is sent to
|
||||
stderr.
|
||||
"""
|
||||
with open(os.devnull, 'wb') as devnull:
|
||||
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=devnull,
|
||||
close_fds=platform.system() != 'Windows',
|
||||
shell=shell)
|
||||
stdout, _ = proc.communicate()
|
||||
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
close_fds=platform.system() != 'Windows',
|
||||
shell=shell)
|
||||
stdout, stderr = proc.communicate()
|
||||
|
||||
if proc.returncode:
|
||||
raise subprocess.CalledProcessError(proc.returncode, cmd)
|
||||
raise subprocess.CalledProcessError(proc.returncode, cmd, stderr)
|
||||
return stdout
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue