Use default stdout and stderr streams for hook processes

This commit is contained in:
Jack Wilsdon 2015-09-12 02:09:19 +01:00
parent 3d058f4b6c
commit ae2ff6185f

View file

@ -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