diff options
author | Kostis Anagnostopoulos <ankostis@gmail.com> | 2016-10-12 23:09:54 +0200 |
---|---|---|
committer | Kostis Anagnostopoulos <ankostis@gmail.com> | 2016-10-13 02:04:18 +0200 |
commit | 85f38a1bbc8fc4b19ebf2a52a3640b59a5dcf9fe (patch) | |
tree | 4f8df05b1a0c0f9168e86743888fcaf92dbfab5f /git/cmd.py | |
parent | 83645971b8e134f45bded528e0e0786819203252 (diff) | |
download | gitpython-85f38a1bbc8fc4b19ebf2a52a3640b59a5dcf9fe.tar.gz |
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).
Diffstat (limited to 'git/cmd.py')
-rw-r--r-- | git/cmd.py | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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): |