From dd08584f7a0dadcec45efc71c871a1bd8932f7aa Mon Sep 17 00:00:00 2001 From: Andrew Murray <3112309+radarhere@users.noreply.github.com> Date: Sun, 17 Oct 2021 10:37:19 +1100 Subject: [PATCH] Updated syntax Co-authored-by: Hugo van Kemenade --- docs/reference/open_files.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/reference/open_files.rst b/docs/reference/open_files.rst index fd6d769b7..f66184ba3 100644 --- a/docs/reference/open_files.rst +++ b/docs/reference/open_files.rst @@ -61,12 +61,14 @@ Image Lifecycle * ``Image.Image.close()`` Closes the file and destroys the core image object. The Pillow context manager will also close the file, but will not destroy - the core image object. e.g.:: + the core image object. e.g.: - with Image.open('test.jpg') as img: +.. code-block:: python + + with Image.open("test.jpg") as img: img.load() assert img.fp is None - img.save('test.png') + img.save("test.png") The lifecycle of a single-frame image is relatively simple. The file must