Skip to content

Commit

Permalink
Deprecate Image.__del__
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Jul 1, 2019
1 parent 469c0ae commit c153836
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions docs/releasenotes/6.1.0.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
6.1.0
-----

Deprecations
============

Image.__del__
^^^^^^^^^^^^^

.. deprecated:: 6.1.0

Implicitly closing the image's underlying file in ``Image.__del__`` has been deprecated.
Use a context manager or call ``Image.close()`` instead to close the file in a
deterministic way.

Deprecated:

.. code-block:: python
im = Image.open("hopper.png")
im.save("out.jpg")
Use instead:

.. code-block:: python
with Image.open("hopper.png") as im:
im.save("out.jpg")
API Additions
=============

Expand Down

0 comments on commit c153836

Please sign in to comment.