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

Skip to content

Commit f08ba30

Browse files
authored
Merge pull request #31060 from timhoffm/mnt-eventson
MNT: Remove unused eventson context from artist property update
2 parents 9a41623 + 87ac5e9 commit f08ba30

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)