Skip to content

Commit 43a1195

Browse files
tacaswelljklymak
authored andcommitted
FIX: catch on message content, not module
Not all of the warnings from pandas report that they are from pandas. Closes matplotlib#16295 (again)
1 parent e4dbf4e commit 43a1195

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/matplotlib/cbook/__init__.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1382,9 +1382,10 @@ def _check_1d(x):
13821382
# This code should correctly identify and coerce to a
13831383
# numpy array all pandas versions.
13841384
with warnings.catch_warnings(record=True) as w:
1385-
warnings.filterwarnings("always",
1386-
category=DeprecationWarning,
1387-
module='pandas[.*]')
1385+
warnings.filterwarnings(
1386+
"always",
1387+
category=DeprecationWarning,
1388+
message='Support for multi-dimensional indexing')
13881389

13891390
ndim = x[:, None].ndim
13901391
# we have definitely hit a pandas index or series object

0 commit comments

Comments
 (0)