(self, fd, name)
| 47 | os.close(fd) |
| 48 | |
| 49 | def _capture(self, fd, name): |
| 50 | assert name not in self._chunks |
| 51 | self._chunks[name] = [] |
| 52 | |
| 53 | thread = threading.Thread( |
| 54 | target=lambda: self._worker(fd, name), name=f"{self} {name}" |
| 55 | ) |
| 56 | thread.daemon = True |
| 57 | thread.start() |
| 58 | self._worker_threads.append(thread) |
| 59 | |
| 60 | def wait(self, timeout=None): |
| 61 | """Wait for all remaining output to be captured.""" |