Skip to content

Commit ec3213b

Browse files
committed
ENH: Make import selection implicit
1 parent 22657e8 commit ec3213b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/matplotlib/cbook.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,11 @@
2121
import types
2222
import weakref
2323

24-
from packaging.version import parse as parse_version
2524
import numpy as np
2625

27-
if parse_version(np.__version__) >= parse_version("1.25.0"):
28-
from numpy.exceptions import VisibleDeprecationWarning
29-
else:
26+
try:
27+
from numpy.exceptions import VisibleDeprecationWarning # numpy >= 1.25
28+
except ImportError:
3029
from numpy import VisibleDeprecationWarning
3130

3231
import matplotlib

0 commit comments

Comments
 (0)