(self)
| 48 | self.http_response.close() |
| 49 | |
| 50 | def __decode__(self) -> Iterator[_T]: |
| 51 | buf = b"" |
| 52 | for chunk in self._raw_iterator: |
| 53 | for line in chunk.splitlines(keepends=True): |
| 54 | buf += line |
| 55 | if buf.endswith((b"\r", b"\n", b"\r\n")): |
| 56 | yield construct_type_unchecked( |
| 57 | value=json.loads(buf), |
| 58 | type_=self._line_type, |
| 59 | ) |
| 60 | buf = b"" |
| 61 | |
| 62 | # flush |
| 63 | if buf: |
| 64 | yield construct_type_unchecked( |
| 65 | value=json.loads(buf), |
| 66 | type_=self._line_type, |
| 67 | ) |
| 68 | |
| 69 | def __next__(self) -> _T: |
| 70 | return self._iterator.__next__() |
no test coverage detected