Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a87f521

Browse files
committed
Merge remote-tracking branch 'upstream/v1.3.x'
2 parents 45bc22e + ddf2c57 commit a87f521

File tree

6 files changed

+24
-8
lines changed

6 files changed

+24
-8
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,7 @@ script:
2323
# Travis VM to run out of memory (since so many copies of inkscape and
2424
# ghostscript are running at the same time).
2525
- echo Testing using 8 processes
26+
# Generate the font caches in a single process before starting the
27+
# multiple processes
28+
- python -c "from matplotlib import font_manager"
2629
- python ../matplotlib/tests.py -sv --processes=8 --process-timeout=300

lib/matplotlib/backend_bases.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2863,6 +2863,18 @@ def press_pan(self, event):
28632863

28642864
def press_zoom(self, event):
28652865
"""the press mouse button in zoom to rect mode callback"""
2866+
# If we're already in the middle of a zoom, pressing another
2867+
# button works to "cancel"
2868+
if self._ids_zoom != []:
2869+
for zoom_id in self._ids_zoom:
2870+
self.canvas.mpl_disconnect(zoom_id)
2871+
self.release(event)
2872+
self.draw()
2873+
self._xypress = None
2874+
self._button_pressed = None
2875+
self._ids_zoom = []
2876+
return
2877+
28662878
if event.button == 1:
28672879
self._button_pressed = 1
28682880
elif event.button == 3:

lib/matplotlib/backends/backend_ps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def set_font(self, fontname, fontsize, store=1):
284284
if (fontname,fontsize) != (self.fontname,self.fontsize):
285285
out = ("/%s findfont\n"
286286
"%1.3f scalefont\n"
287-
"setfont\n" % (fontname.decode('ascii'), fontsize))
287+
"setfont\n" % (fontname, fontsize))
288288

289289
self._pswriter.write(out)
290290
if store: self.fontname = fontname

lib/matplotlib/font_manager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,14 +391,14 @@ def ttfFontProperty(font):
391391
sfnt2 = sfnt.get((1,0,0,2))
392392
sfnt4 = sfnt.get((1,0,0,4))
393393
if sfnt2:
394-
sfnt2 = sfnt2.lower()
394+
sfnt2 = sfnt2.decode('ascii').lower()
395395
else:
396396
sfnt2 = ''
397397
if sfnt4:
398-
sfnt4 = sfnt4.lower()
398+
sfnt4 = sfnt4.decode('ascii').lower()
399399
else:
400400
sfnt4 = ''
401-
if sfnt4.find('oblique') >= 0:
401+
if sfnt4.find('oblique') >= 0:
402402
style = 'oblique'
403403
elif sfnt4.find('italic') >= 0:
404404
style = 'italic'

lib/matplotlib/testing/decorators.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,10 @@ def find_dotted_module(module_name, path=None):
271271
"""A version of imp which can handle dots in the module name"""
272272
res = None
273273
for sub_mod in module_name.split('.'):
274-
res = _, path, _ = imp.find_module(sub_mod, path)
274+
res = file, path, _ = imp.find_module(sub_mod, path)
275275
path = [path]
276+
if file is not None:
277+
file.close()
276278
return res
277279

278280
mod_file = find_dotted_module(func.__module__)[1]

lib/matplotlib/textpath.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,9 @@ def _get_char_id(self, font, ccode):
6363
"""
6464
sfnt = font.get_sfnt()
6565
try:
66-
ps_name = sfnt[(1, 0, 0, 6)]
66+
ps_name = sfnt[(1, 0, 0, 6)].decode('ascii')
6767
except KeyError:
68-
ps_name = sfnt[(3, 1, 0x0409, 6)].decode(
69-
'utf-16be').encode('ascii', 'replace')
68+
ps_name = sfnt[(3, 1, 0x0409, 6)].decode('utf-16be')
7069
char_id = urllib.quote('%s-%x' % (ps_name, ccode))
7170
return char_id
7271

0 commit comments

Comments
 (0)