MCPcopy
hub / github.com/encode/httpx / flush

Method flush

httpx/_decoders.py:145–158  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

143 raise DecodingError(str(exc)) from exc
144
145 def flush(self) -> bytes:
146 if not self.seen_data:
147 return b""
148 try:
149 if hasattr(self.decompressor, "finish"):
150 # Only available in the 'brotlicffi' package.
151
152 # As the decompressor decompresses eagerly, this
153 # will never actually emit any data. However, it will potentially throw
154 # errors if a truncated or damaged data stream has been used.
155 self.decompressor.finish() # pragma: no cover
156 return b""
157 except brotli.error as exc: # pragma: no cover
158 raise DecodingError(str(exc)) from exc
159
160
161class ZStandardDecoder(ContentDecoder):

Callers

nothing calls this directly

Calls 1

DecodingErrorClass · 0.85

Tested by

no test coverage detected