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

Skip to content

Commit 87ac5e9

Browse files
committed
MNT: Remove unused eventson context from artist property update
The attribute `eventson` was introduced in 79aa291. While it was set on and off in various places, there has never been any code that made logic depend on its state. The attribute itself was removed in #18910, but its toggling through the context manager was overlooked there. Note: There is another `eventson` in widgets.py, which is completely independent on this here, because widgets are not Artists.
1 parent e3776e9 commit 87ac5e9

1 file changed

Lines changed: 12 additions & 13 deletions

File tree

lib/matplotlib/artist.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,19 +1228,18 @@ def _update_props(self, props, errfmt):
12281228
property name for "{prop_name}".
12291229
"""
12301230
ret = []
1231-
with cbook._setattr_cm(self, eventson=False):
1232-
for k, v in props.items():
1233-
# Allow attributes we want to be able to update through
1234-
# art.update, art.set, setp.
1235-
if k == "axes":
1236-
ret.append(setattr(self, k, v))
1237-
else:
1238-
func = getattr(self, f"set_{k}", None)
1239-
if not callable(func):
1240-
raise AttributeError(
1241-
errfmt.format(cls=type(self), prop_name=k),
1242-
name=k)
1243-
ret.append(func(v))
1231+
for k, v in props.items():
1232+
# Allow attributes we want to be able to update through
1233+
# art.update, art.set, setp.
1234+
if k == "axes":
1235+
ret.append(setattr(self, k, v))
1236+
else:
1237+
func = getattr(self, f"set_{k}", None)
1238+
if not callable(func):
1239+
raise AttributeError(
1240+
errfmt.format(cls=type(self), prop_name=k),
1241+
name=k)
1242+
ret.append(func(v))
12441243
if ret:
12451244
self.pchanged()
12461245
self.stale = True

0 commit comments

Comments
 (0)