| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 3565888 commit 4a5ceba
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -69,6 +69,10 @@ def _bchr(c): | |||
| 69 | 69 | # Documentation | |
| 70 | 70 | ## @{ | |
| 71 | 71 | ||
| 72 | + def _drop_output_handler(line): | ||
| 73 | + pass | ||
| 74 | + | ||
| 75 | + | ||
| 72 | 76 | def handle_process_output(process, stdout_handler, stderr_handler, finalizer): | |
| 73 | 77 | """Registers for notifications to lean that process output is ready to read, and dispatches lines to | |
| 74 | 78 | the respective line handlers. We are able to handle carriage returns in case progress is sent by that | |
@@ -79,6 +83,13 @@ def handle_process_output(process, stdout_handler, stderr_handler, finalizer): | |||
| 79 | 83 | :param stdout_handler: f(stdout_line_string), or None | |
| 80 | 84 | :param stderr_hanlder: f(stderr_line_string), or None | |
| 81 | 85 | :param finalizer: f(proc) - wait for proc to finish""" | |
| 86 | + | ||
| 87 | + log.debug('handle_process_output( process=%r, stdout_handler=%r, stderr_handler=%r, finalizer=%r' | ||
| 88 | + % (process, stdout_handler, stderr_handler, finalizer)) | ||
| 89 | + | ||
| 90 | + if stdout_handler is None: | ||
| 91 | + stdout_handler = _drop_output_handler | ||
| 92 | + | ||
| 82 | 93 | fdmap = {process.stdout.fileno(): (stdout_handler, [b'']), | |
| 83 | 94 | process.stderr.fileno(): (stderr_handler, [b''])} | |
| 84 | 95 | ||
@@ -119,6 +130,7 @@ def _dispatch_single_line(line, handler): | |||
| 119 | 130 | # end single line helper | |
| 120 | 131 | ||
| 121 | 132 | def _dispatch_lines(fno, handler, buf_list): | |
| 133 | + log.debug('fno=%d, handler=%r, buf_list=%r' % (fno, handler, buf_list)) | ||
| 122 | 134 | lc = 0 | |
| 123 | 135 | for line in _read_lines_from_fno(fno, buf_list): | |
| 124 | 136 | _dispatch_single_line(line, handler) | |
@@ -332,6 +344,7 @@ def read_all_from_possibly_closed_stream(stream): | |||
| 332 | 344 | ||
| 333 | 345 | if status != 0: | |
| 334 | 346 | errstr = read_all_from_possibly_closed_stream(self.proc.stderr) | |
| 347 | + log.debug('AutoInterrupt wait stderr: %r' % (errstr,)) | ||
| 335 | 348 | raise GitCommandError(self.args, status, errstr) | |
| 336 | 349 | # END status handling | |
| 337 | 350 | return status | |
@@ -618,7 +631,7 @@ def execute(self, command, | |||
| 618 | 631 | bufsize=-1, | |
| 619 | 632 | stdin=istream, | |
| 620 | 633 | stderr=PIPE, | |
| 621 | - stdout=PIPE if with_stdout else open(os.devnull, 'wb'), | ||
| 634 | + stdout=PIPE, | ||
| 622 | 635 | shell=self.USE_SHELL, | |
| 623 | 636 | close_fds=(os.name == 'posix'), # unsupported on windows | |
| 624 | 637 | universal_newlines=universal_newlines, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments