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.
2 parents 0c7f83d + df428f0 commit 7514e3eCopy full SHA for 7514e3e
2 files changed
examples/pylab_examples/font_table_ttf.py
100644
100755
@@ -32,7 +32,7 @@
32
for ccode, glyphind in codes:
33
if ccode>=256: continue
34
r,c = divmod(ccode,16)
35
- s = chr(ccode)
+ s = unichr(ccode)
36
chars[r][c] = s
37
38
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