(self, data: bytes)
| 65 | self.decompressor = zlib.decompressobj() |
| 66 | |
| 67 | def decode(self, data: bytes) -> bytes: |
| 68 | was_first_attempt = self.first_attempt |
| 69 | self.first_attempt = False |
| 70 | try: |
| 71 | return self.decompressor.decompress(data) |
| 72 | except zlib.error as exc: |
| 73 | if was_first_attempt: |
| 74 | self.decompressor = zlib.decompressobj(-zlib.MAX_WBITS) |
| 75 | return self.decode(data) |
| 76 | raise DecodingError(str(exc)) from exc |
| 77 | |
| 78 | def flush(self) -> bytes: |
| 79 | try: |
nothing calls this directly
no test coverage detected