Skip to content

Commit c45beef

Browse files
authored
Merge pull request #16379 from tacaswell/fix_pandas_warning_catch
FIX: catch on message content, not module
2 parents e4dbf4e + b53b588 commit c45beef

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/matplotlib/cbook/__init__.py

Lines changed: 4 additions & 3 deletions
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)