Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 838502e

Browse filesBrowse files
committed
Merge pull request #5448 from zblz/fix-vlist-subsuper
Fix #5444: do not access subsuper nucleus _metrics if not available
2 parents d6354b8 + 4b10fdf commit 838502e
Copy full SHA for 838502e
Expand file treeCollapse file tree

17 files changed

+894
-2
lines changed

‎lib/matplotlib/mathtext.py

Copy file name to clipboardExpand all lines: lib/matplotlib/mathtext.py
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2859,10 +2859,12 @@ def subsuper(self, s, loc, toks):
28592859
new_children = nucleus.children
28602860
if len(new_children):
28612861
# remove last kern
2862-
if isinstance(new_children[-1],Kern):
2862+
if (isinstance(new_children[-1],Kern) and
2863+
hasattr(new_children[-2], '_metrics')):
28632864
new_children = new_children[:-1]
28642865
last_char = new_children[-1]
2865-
last_char.width = last_char._metrics.advance
2866+
if hasattr(last_char, '_metrics'):
2867+
last_char.width = last_char._metrics.advance
28662868
# create new Hlist without kerning
28672869
nucleus = Hlist(new_children, do_kern=False)
28682870
else:
Binary file not shown.
Loading
+236Lines changed: 236 additions & 0 deletions
Loading
Binary file not shown.
Loading
+134Lines changed: 134 additions & 0 deletions
Loading
Binary file not shown.
Loading

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.