8000 Merge pull request #12307 from anntzer/property-missing-message · matplotlib/matplotlib@1c55a25 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1c55a25

Browse files
authored
Merge pull request #12307 from anntzer/property-missing-message
Clarify missing-property error message.
2 parents f4a7fea + 4705a30 commit 1c55a25

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/artist.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,8 @@ def _update_property(self, k, v):
965965
else:
966966
func = getattr(self, 'set_' + k, None)
967967
if not callable(func):
968-
raise AttributeError('Unknown property %s' % k)
968+
raise AttributeError('{!r} object has no property {!r}'
969+
.format(type(self).__name__, k))
969970
return func(v)
970971

971972
with cbook._setattr_cm(self, eventson=False):

0 commit comments

Comments
 (0)
0