diff --git a/lib/matplotlib/artist.py b/lib/matplotlib/artist.py index bb2a2de6b0e9..799cc0cd93f8 100644 --- a/lib/matplotlib/artist.py +++ b/lib/matplotlib/artist.py @@ -965,7 +965,8 @@ def _update_property(self, k, v): else: func = getattr(self, 'set_' + k, None) if not callable(func): - raise AttributeError('Unknown property %s' % k) + raise AttributeError('{!r} object has no property {!r}' + .format(type(self).__name__, k)) return func(v) with cbook._setattr_cm(self, eventson=False):