From 551d9e9aaa2b25caed84055b9d49fec11c251fdd Mon Sep 17 00:00:00 2001 From: Importance of Being Ernest Date: Thu, 15 Feb 2018 02:17:10 +0100 Subject: [PATCH] update example docstring of afm.py In order for the example to work in python 3, the file needs to be read in binary mode: `open(afm_fname, 'rb')` --- lib/matplotlib/afm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/afm.py b/lib/matplotlib/afm.py index 5a2cffbfbb7b..1b5f4d5f6a0d 100644 --- a/lib/matplotlib/afm.py +++ b/lib/matplotlib/afm.py @@ -19,7 +19,7 @@ ... 'fonts', 'afm', 'ptmr8a.afm') >>> >>> from matplotlib.afm import AFM - >>> with open(afm_fname) as fh: + >>> with open(afm_fname, 'rb') as fh: ... afm = AFM(fh) >>> afm.string_width_height('What the heck?') (6220.0, 694)