Skip to content

Commit d05281f

Browse files
committed
Improved documentation for cleanup() in Python codecs
1 parent 95e3194 commit d05281f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

docs/handbook/writing-your-own-image-plugin.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,4 +441,9 @@ Python-based file codec:
441441
In ``decode``, once the data has been interpreted, ``set_as_raw`` can be
442442
used to populate the image.
443443

444-
3. Cleanup: The instance's ``cleanup`` method is called.
444+
3. Cleanup: The instance's ``cleanup`` method is called once the transformation
445+
is complete. This can be used to clean up any resources used by the codec.
446+
447+
If you set ``_pulls_fd`` or ``_pushes_fd`` to ``True`` however, then you
448+
probably chose to perform any cleanup tasks at the end of ``decode`` or
449+
``encode``.

0 commit comments

Comments
 (0)