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

Skip to content

Commit 7132283

Browse files
committed
Merge pull request #5448 from zblz/fix-vlist-subsuper
Fix #5444: do not access subsuper nucleus _metrics if not available
1 parent 46e9f22 commit 7132283

17 files changed

+894
-2
lines changed

lib/matplotlib/mathtext.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2803,10 +2803,12 @@ def subsuper(self, s, loc, toks):
28032803
new_children = nucleus.children
28042804
if len(new_children):
28052805
# remove last kern
2806-
if isinstance(new_children[-1],Kern):
2806+
if (isinstance(new_children[-1],Kern) and
2807+
hasattr(new_children[-2], '_metrics')):
28072808
new_children = new_children[:-1]
28082809
last_char = new_children[-1]
2809-
last_char.width = last_char._metrics.advance
2810+
if hasattr(last_char, '_metrics'):
2811+
last_char.width = last_char._metrics.advance
28102812
# create new Hlist without kerning
28112813
nucleus = Hlist(new_children, do_kern=False)
28122814
else:
Binary file not shown.
Lines changed: 236 additions & 0 deletions
Loading
Binary file not shown.
Lines changed: 134 additions & 0 deletions
Loading
Binary file not shown.

0 commit comments

Comments
 (0)