|
61 | 61 | ## @{ |
62 | 62 |
|
63 | 63 | def handle_process_output(process, stdout_handler, stderr_handler, |
64 | | - finalizer=None, decode_streams=True): |
| 64 | + finalizer=None, decode_streams=True, nojoin=False): |
65 | 65 | """Registers for notifications to lean that process output is ready to read, and dispatches lines to |
66 | 66 | the respective line handlers. |
67 | 67 | This function returns once the finalizer returns |
@@ -112,8 +112,9 @@ def pump_stream(cmdline, name, stream, is_decode, handler): |
112 | 112 |
|
113 | 113 | ## FIXME: Why Join?? Will block if `stdin` needs feeding... |
114 | 114 | # |
115 | | - for t in threads: |
116 | | - t.join() |
| 115 | + if not nojoin: |
| 116 | + for t in threads: |
| 117 | + t.join() |
117 | 118 |
|
118 | 119 | if finalizer: |
119 | 120 | return finalizer(process) |
@@ -580,8 +581,9 @@ def execute(self, command, |
580 | 581 | stdout_sink = (PIPE |
581 | 582 | if with_stdout |
582 | 583 | else getattr(subprocess, 'DEVNULL', open(os.devnull, 'wb'))) |
583 | | - log.debug("Popen(%s, cwd=%s, universal_newlines=%s, shell=%s)", |
584 | | - command, cwd, universal_newlines, shell) |
| 584 | + import subprocess as sb |
| 585 | + log.debug("Popen(%s, cwd=%s, universal_newlines=%s, shell=%s,\n_active=%s)", |
| 586 | + command, cwd, universal_newlines, shell, sb._active) |
585 | 587 | try: |
586 | 588 | proc = Popen(command, |
587 | 589 | env=env, |
|
0 commit comments