| 167 | |
| 168 | |
| 169 | class CaptureIO(io.TextIOWrapper): |
| 170 | def __init__(self) -> None: |
| 171 | super().__init__(io.BytesIO(), encoding="UTF-8", newline="", write_through=True) |
| 172 | |
| 173 | def getvalue(self) -> str: |
| 174 | assert isinstance(self.buffer, io.BytesIO) |
| 175 | return self.buffer.getvalue().decode("UTF-8") |
| 176 | |
| 177 | |
| 178 | class TeeCaptureIO(CaptureIO): |