mirror of
https://github.com/beetbox/beets.git
synced 2025-12-25 01:53:31 +01:00
Use default stdout and stderr streams for hook processes
This commit is contained in:
parent
3d058f4b6c
commit
ae2ff6185f
1 changed files with 1 additions and 7 deletions
|
|
@ -50,15 +50,9 @@ def create_hook_function(log, event, command, shell, substitute_args):
|
|||
log.debug('Running command {0} for event {1}', hook_command, event)
|
||||
|
||||
process = subprocess.Popen(hook_command,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT,
|
||||
shell=shell)
|
||||
|
||||
while process.poll() is None:
|
||||
sys.stdout.write(process.stdout.readline())
|
||||
|
||||
# Ensure there's nothing left in the stream
|
||||
sys.stdout.write(process.stdout.readline())
|
||||
process.wait()
|
||||
|
||||
return hook_function
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue