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

Skip to content

Commit bb25d83

Browse files
committed
test_text Modify filter warning regex
The regex will not match in python 2 since this is a unicode literal. Fix that by adding an optional 'u' to the regex.
1 parent b48856b commit bb25d83

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/tests/test_text.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ def find_matplotlib_font(**kw):
2222
return FontProperties(fname=path)
2323

2424
from matplotlib.font_manager import FontProperties, findfont
25-
warnings.filterwarnings('ignore', 'findfont: Font family \[\'Foo\'\] '+ \
26-
'not found. Falling back to .',
25+
warnings.filterwarnings('ignore', ('findfont: Font family \[u?\'Foo\'\] '+
26+
'not found. Falling back to .'),
2727
UserWarning,
2828
module='matplotlib.font_manager')
2929
fig = plt.figure()

0 commit comments

Comments
 (0)