Read until the prompt is reached.
(self, terminator)
| 86 | self._proc = None |
| 87 | |
| 88 | def _read_until(self, terminator): |
| 89 | """Read until the prompt is reached.""" |
| 90 | buf = bytearray() |
| 91 | while True: |
| 92 | c = self._proc.stdout.read(1) |
| 93 | if not c: |
| 94 | raise _ConverterError(os.fsdecode(bytes(buf))) |
| 95 | buf.extend(c) |
| 96 | if buf.endswith(terminator): |
| 97 | return bytes(buf) |
| 98 | |
| 99 | |
| 100 | class _MagickConverter: |
no test coverage detected