Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9e0747b

Browse files
authored
Merge pull request matplotlib#23246 from oscargus/imageinterpolationfix
2 parents 10b26c9 + 07bf940 commit 9e0747b

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

lib/matplotlib/_api/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ def check_in_list(_values, *, _print_supported_values=True, **kwargs):
120120
--------
121121
>>> _api.check_in_list(["foo", "bar"], arg=arg, other_arg=other_arg)
122122
"""
123+
if not kwargs:
124+
raise TypeError("No argument to check!")
123125
values = _values
124126
for key, val in kwargs.items():
125127
if val not in values:

lib/matplotlib/image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ def set_interpolation_stage(self, s):
787787
"""
788788
if s is None:
789789
s = "data" # placeholder for maybe having rcParam
790-
_api.check_in_list(['data', 'rgba'])
790+
_api.check_in_list(['data', 'rgba'], s=s)
791791
self._interpolation_stage = s
792792
self.stale = True
793793

lib/matplotlib/tests/test_api.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,8 @@ def test_deprecation_alternative():
9393
def f():
9494
pass
9595
assert alternative in f.__doc__
96+
97+
98+
def test_empty_check_in_list():
99+
with pytest.raises(TypeError, match="No argument to check!"):
100+
_api.check_in_list(["a"])

0 commit comments

Comments
 (0)