We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6510bc4 commit 63cc389Copy full SHA for 63cc389
lib/matplotlib/spines.py
@@ -550,7 +550,7 @@ def __getattr__(self, name):
550
try:
551
return self._dict[name]
552
except KeyError:
553
- raise ValueError(
+ raise AttributeError(
554
f"'Spines' object does not contain a '{name}' spine")
555
556
def __getitem__(self, key):
lib/matplotlib/tests/test_spines.py
@@ -35,6 +35,8 @@ def set_val(self, val):
35
spines[:].set_val('y')
36
assert all(spine.val == 'y' for spine in spines.values())
37
38
+ with pytest.raises(AttributeError, match='foo'):
39
+ spines.foo
40
with pytest.raises(KeyError, match='foo'):
41
spines['foo']
42
with pytest.raises(KeyError, match='foo, bar'):
0 commit comments