File tree Expand file tree Collapse file tree 2 files changed +8
-14
lines changed Expand file tree Collapse file tree 2 files changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -1597,19 +1597,16 @@ def _load_file(self, path):
1597
1597
try :
1598
1598
ikw_proplot , ikw_matplotlib = self ._get_item_dicts (key , val )
1599
1599
except KeyError :
1600
- warnings ._warn_proplot (
1601
- f'Invalid rc key { key !r} on { message } .' , 'default'
1602
- )
1600
+ warnings .simplefilter ('default' , warnings .ProplotWarning )
1601
+ warnings ._warn_proplot (f'Invalid rc key { key !r} on { message } .' )
1603
1602
continue
1604
1603
except ValueError as err :
1605
- warnings ._warn_proplot (
1606
- f'Invalid rc val { val !r} for key { key !r} on { message } : { err } ' , 'default' # noqa: E501
1607
- )
1604
+ warnings .simplefilter ('default' , warnings .ProplotWarning )
1605
+ warnings ._warn_proplot (f'Invalid rc val { val !r} for key { key !r} on { message } : { err } ' ) # noqa: E501
1608
1606
continue
1609
1607
except warnings .ProplotWarning as err :
1610
- warnings ._warn_proplot (
1611
- f'Outdated rc key { key !r} on { message } : { err } ' , 'default'
1612
- )
1608
+ warnings .simplefilter ('default' , warnings .ProplotWarning )
1609
+ warnings ._warn_proplot (f'Outdated rc key { key !r} on { message } : { err } ' ) # noqa: E501
1613
1610
warnings .simplefilter ('ignore' , warnings .ProplotWarning )
1614
1611
ikw_proplot , ikw_matplotlib = self ._get_item_dicts (key , val )
1615
1612
# Update the settings
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ def _next_release():
35
35
return string
36
36
37
37
38
- def _warn_proplot (message , action = None ):
38
+ def _warn_proplot (message ):
39
39
"""
40
40
Emit a `ProplotWarning` and show the stack level outside of matplotlib and
41
41
proplot. This is adapted from matplotlib's warning system.
@@ -47,10 +47,7 @@ def _warn_proplot(message, action=None):
47
47
break # this is the first external frame
48
48
frame = frame .f_back
49
49
stacklevel += 1
50
- with warnings .catch_warnings ():
51
- if action : # used internally
52
- warnings .simplefilter (action , ProplotWarning )
53
- warnings .warn (message , ProplotWarning , stacklevel = stacklevel )
50
+ warnings .warn (message , ProplotWarning , stacklevel = stacklevel )
54
51
55
52
56
53
def _rename_objs (version , ** kwargs ):
You can’t perform that action at this time.
0 commit comments