File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 2121import types
2222import weakref
2323
24+ from packaging .version import parse as parse_version
2425import numpy as np
2526
27+ if parse_version (np .__version__ ) >= parse_version ("1.25.0" ):
28+ from numpy .exceptions import VisibleDeprecationWarning
29+ else :
30+ from numpy import VisibleDeprecationWarning
31+
2632import matplotlib
2733from matplotlib import _api , _c_internal_utils
2834
@@ -1064,7 +1070,7 @@ def _combine_masks(*args):
10641070 raise ValueError ("Masked arrays must be 1-D" )
10651071 try :
10661072 x = np .asanyarray (x )
1067- except (np . VisibleDeprecationWarning , ValueError ):
1073+ except (VisibleDeprecationWarning , ValueError ):
10681074 # NumPy 1.19 raises a warning about ragged arrays, but we want
10691075 # to accept basically anything here.
10701076 x = np .asanyarray (x , dtype = object )
@@ -1658,7 +1664,7 @@ def index_of(y):
16581664 pass
16591665 try :
16601666 y = _check_1d (y )
1661- except (np . VisibleDeprecationWarning , ValueError ):
1667+ except (VisibleDeprecationWarning , ValueError ):
16621668 # NumPy 1.19 will warn on ragged input, and we can't actually use it.
16631669 pass
16641670 else :
You can’t perform that action at this time.
0 commit comments