Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0a35fe4

Browse filesBrowse files
committed
Don't use catch_warnings
1 parent 21b129f commit 0a35fe4
Copy full SHA for 0a35fe4

File tree

Expand file treeCollapse file tree

1 file changed

+8
-8
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-8
lines changed

‎lib/matplotlib/style/core.py

Copy file name to clipboardExpand all lines: lib/matplotlib/style/core.py
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,14 @@
4343
'savefig.directory', 'tk.window_focus', 'hardcopy.docstring'])
4444

4545

46-
def _remove_blacklisted_style_params(d):
46+
def _remove_blacklisted_style_params(d, warn=True):
4747
o = {}
4848
for key, val in d.items():
4949
if key in STYLE_BLACKLIST:
50-
warnings.warn(
51-
"Style includes a parameter, '{0}', that is not related to "
52-
"style. Ignoring".format(key))
50+
if warn:
51+
warnings.warn(
52+
"Style includes a parameter, '{0}', that is not related "
53+
"to style. Ignoring".format(key))
5354
else:
5455
o[key] = val
5556
return o
@@ -60,8 +61,8 @@ def is_style_file(filename):
6061
return STYLE_FILE_PATTERN.match(filename) is not None
6162

6263

63-
def _apply_style(d):
64-
mpl.rcParams.update(_remove_blacklisted_style_params(d))
64+
def _apply_style(d, warn=True):
65+
mpl.rcParams.update(_remove_blacklisted_style_params(d, warn=warn))
6566

6667

6768
def use(style):
@@ -98,8 +99,7 @@ def use(style):
9899
if not cbook.is_string_like(style):
99100
_apply_style(style)
100101
elif style == 'default':
101-
with warnings.catch_warnings(record=True):
102-
_apply_style(rcParamsDefault)
102+
_apply_style(rcParamsDefault, warn=False)
103103
elif style in library:
104104
_apply_style(library[style])
105105
else:

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.