Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 519322f commit df428f0Copy full SHA for df428f0
1 file changed
lib/matplotlib/cbook.py
@@ -1820,7 +1820,11 @@ def __call__(self, key):
1820
def is_math_text(s):
1821
# Did we find an even number of non-escaped dollar signs?
1822
# If so, treat is as math text.
1823
- s = unicode(s)
+ try:
1824
+ s = unicode(s)
1825
+ except UnicodeDecodeError:
1826
+ raise ValueError(
1827
+ "matplotlib display text must have all code points < 128 or use Unicode strings")
1828
1829
dollar_count = s.count(r'$') - s.count(r'\$')
1830
even_dollars = (dollar_count > 0 and dollar_count % 2 == 0)
0 commit comments