| 749 | await ret |
| 750 | |
| 751 | def finish(self) -> None: |
| 752 | if self._decompressor is not None: |
| 753 | tail = self._decompressor.flush() |
| 754 | if tail: |
| 755 | # The tail should always be empty: decompress returned |
| 756 | # all that it can in data_received and the only |
| 757 | # purpose of the flush call is to detect errors such |
| 758 | # as truncated input. If we did legitimately get a new |
| 759 | # chunk at this point we'd need to change the |
| 760 | # interface to make finish() a coroutine. |
| 761 | raise ValueError( |
| 762 | "decompressor.flush returned data; possible truncated input" |
| 763 | ) |
| 764 | return self._delegate.finish() |
| 765 | |
| 766 | def on_connection_close(self) -> None: |
| 767 | return self._delegate.on_connection_close() |