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

Skip to content

Commit e7f965a

Browse files
committed
Remove some code for compatibility with pyparsing<3
1 parent 45caf0e commit e7f965a

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

lib/matplotlib/_mathtext.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from numpy.typing import NDArray
2525
from pyparsing import (
2626
Empty, Forward, Literal, Group, NotAny, OneOrMore, Optional,
27-
ParseBaseException, ParseException, ParseExpression, ParseFatalException,
27+
ParseBaseException, ParseExpression, ParseFatalException,
2828
ParserElement, ParseResults, QuotedString, Regex, StringEnd, ZeroOrMore,
2929
pyparsing_common, nested_expr, one_of)
3030

@@ -2162,8 +2162,7 @@ def parse(self, s: str, fonts_object: Fonts, fontsize: float, dpi: float) -> Hli
21622162
try:
21632163
result = self._expression.parse_string(s)
21642164
except ParseBaseException as err:
2165-
# explain becomes a plain method on pyparsing 3 (err.explain(0)).
2166-
raise ValueError("\n" + ParseException.explain(err, 0)) from None
2165+
raise ValueError("\n" + err.explain(0)) from None
21672166
self._state_stack = []
21682167
self._in_subscript_or_superscript = False
21692168
# prevent operator spacing from leaking into a new expression

0 commit comments

Comments
 (0)