diff --git a/lib/matplotlib/_mathtext.py b/lib/matplotlib/_mathtext.py index 3a934c21fd50..7ca0dcd5b615 100644 --- a/lib/matplotlib/_mathtext.py +++ b/lib/matplotlib/_mathtext.py @@ -1802,8 +1802,11 @@ def __init__(self): def set_names_and_parse_actions(): for key, val in vars(p).items(): if not key.startswith('_'): - # Set names on everything -- very useful for debugging - val.setName(key) + # Set names on (almost) everything -- very useful for debugging + # token, placeable, and auto_delim are forward references which + # are left without names to ensure useful error messages + if key not in ("token", "placeable", "auto_delim"): + val.setName(key) # Set actions if hasattr(self, key): val.setParseAction(getattr(self, key))