From 85f38a1bbc8fc4b19ebf2a52a3640b59a5dcf9fe Mon Sep 17 00:00:00 2001 From: Kostis Anagnostopoulos Date: Wed, 12 Oct 2016 23:09:54 +0200 Subject: remote, #525: pump fetch-infos instead of GIL-read stderr + `handle_process_output()` accepts null-finalizer, to pump completely stderr before raising any errors. + test: Enable `TestGit.test_environment()` on Windows (to checks stderr consumption). --- git/cmd.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'git/cmd.py') diff --git a/git/cmd.py b/git/cmd.py index aa711168..ebf2bd75 100644 --- a/git/cmd.py +++ b/git/cmd.py @@ -59,7 +59,8 @@ __all__ = ('Git',) # Documentation ## @{ -def handle_process_output(process, stdout_handler, stderr_handler, finalizer, decode_streams=True): +def handle_process_output(process, stdout_handler, stderr_handler, + finalizer=None, decode_streams=True): """Registers for notifications to lean that process output is ready to read, and dispatches lines to the respective line handlers. This function returns once the finalizer returns @@ -108,10 +109,13 @@ def handle_process_output(process, stdout_handler, stderr_handler, finalizer, de t.start() threads.append(t) + ## FIXME: Why Join?? Will block if `stdin` needs feeding... + # for t in threads: t.join() - return finalizer(process) + if finalizer: + return finalizer(process) def dashify(string): -- cgit v1.2.3