| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -100,16 +100,16 @@ def _parse_lines_from_buffer(buf): | |||
| 100 | 100 | # end | |
| 101 | 101 | ||
| 102 | 102 | def _read_lines_from_fno(fno, last_buf_list): | |
| 103 | - buf = os.read(fno, mmap.PAGESIZE) | ||
| 104 | - buf = last_buf_list[0] + buf | ||
| 103 | + for buf in iter(lambda: os.read(fno, mmap.PAGESIZE), b''): | ||
| 104 | + buf = last_buf_list[0] + buf | ||
| 105 | 105 | ||
| 106 | - bi = 0 | ||
| 107 | - for bi, line in _parse_lines_from_buffer(buf): | ||
| 108 | - yield line | ||
| 109 | - # for each line to parse from the buffer | ||
| 106 | + bi = 0 | ||
| 107 | + for bi, line in _parse_lines_from_buffer(buf): | ||
| 108 | + yield line | ||
| 109 | + # for each line to parse from the buffer | ||
| 110 | 110 | ||
| 111 | - # keep remainder | ||
| 112 | - last_buf_list[0] = buf[bi:] | ||
| 111 | + # keep remainder | ||
| 112 | + last_buf_list[0] = buf[bi:] | ||
| 113 | 113 | ||
| 114 | 114 | def _dispatch_single_line(line, handler): | |
| 115 | 115 | line = line.decode(defenc) | |
@@ -199,6 +199,7 @@ def _deplete_buffer(fno, handler, buf_list, wg=None): | |||
| 199 | 199 | for fno, (handler, buf_list) in fdmap.items(): | |
| 200 | 200 | wg.add(1) | |
| 201 | 201 | t = threading.Thread(target=lambda: _deplete_buffer(fno, handler, buf_list, wg)) | |
| 202 | + t.setDaemon(True) | ||
| 202 | 203 | t.start() | |
| 203 | 204 | # end | |
| 204 | 205 | # NOTE: Just joining threads can possibly fail as there is a gap between .start() and when it's | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -238,7 +238,9 @@ def counter_stderr(line): | |||
| 238 | 238 | stdin=None, | |
| 239 | 239 | stdout=subprocess.PIPE, | |
| 240 | 240 | stderr=subprocess.PIPE, | |
| 241 | - shell=False) | ||
| 241 | + shell=False, | ||
| 242 | + creationflags=Git.CREATE_NO_WINDOW if sys.platform == 'win32' else 0, | ||
| 243 | + ) | ||
| 242 | 244 | ||
| 243 | 245 | handle_process_output(proc, counter_stdout, counter_stderr, lambda proc: proc.wait()) | |
| 244 | 246 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments