File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -331,10 +331,14 @@ Compressing and decompressing data in memory
331331
332332 If *max_length * is non-negative, the method returns at most *max_length *
333333 bytes of decompressed data. If this limit is reached and further
334- output can be produced, the :attr: `~.needs_input ` attribute will
335- be set to ``False ``. In this case, the next call to
334+ output can be produced (or EOF is reached) , the :attr: `~.needs_input `
335+ attribute will be set to ``False ``. In this case, the next call to
336336 :meth: `~.decompress ` may provide *data * as ``b'' `` to obtain
337- more of the output.
337+ more of the output. The full content can thus be read like::
338+
339+ process_output(d.decompress(data, max_length))
340+ while not d.eof and not d.needs_input:
341+ process_output(d.decompress(b"", max_length))
338342
339343 If all of the input data was decompressed and returned (either
340344 because this was less than *max_length * bytes, or because
You can’t perform that action at this time.
0 commit comments