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 21
21
import types
22
22
import weakref
23
23
24
+ from packaging .version import parse as parse_version
24
25
import numpy as np
25
26
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
+
26
32
import matplotlib
27
33
from matplotlib import _api , _c_internal_utils
28
34
@@ -1064,7 +1070,7 @@ def _combine_masks(*args):
1064
1070
raise ValueError ("Masked arrays must be 1-D" )
1065
1071
try :
1066
1072
x = np .asanyarray (x )
1067
- except (np . VisibleDeprecationWarning , ValueError ):
1073
+ except (VisibleDeprecationWarning , ValueError ):
1068
1074
# NumPy 1.19 raises a warning about ragged arrays, but we want
1069
1075
# to accept basically anything here.
1070
1076
x = np .asanyarray (x , dtype = object )
@@ -1658,7 +1664,7 @@ def index_of(y):
1658
1664
pass
1659
1665
try :
1660
1666
y = _check_1d (y )
1661
- except (np . VisibleDeprecationWarning , ValueError ):
1667
+ except (VisibleDeprecationWarning , ValueError ):
1662
1668
# NumPy 1.19 will warn on ragged input, and we can't actually use it.
1663
1669
pass
1664
1670
else :
You can’t perform that action at this time.
0 commit comments