Fix code example

Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
This commit is contained in:
Hugo van Kemenade 2021-11-11 11:27:13 +02:00 committed by GitHub
parent 18d34b287f
commit 81af72bb89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,10 +79,11 @@ TrueType fonts may now be pickled and unpickled. For example:
.. code-block:: python
from PIL import Image, ImageDraw, ImageFont
import pickle
from PIL import ImageFont
font = ImageFont.truetype("arial.ttf", size=30)
pickled_font = pickle.dumps(font1, protocol=pickle.HIGHEST_PROTOCOL)
pickled_font = pickle.dumps(font, protocol=pickle.HIGHEST_PROTOCOL)
# Later...
unpickled_font = pickle.loads(pickled_font)