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

Skip to content

Commit a54f466

Browse files
authored
Merge pull request #9772 from tacaswell/fix_textwidget_disconnect
FIX: TextBox.disconnect remove from registries that TextBox has
2 parents c66c423 + 6efb8c3 commit a54f466

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/matplotlib/widgets.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -928,10 +928,11 @@ def on_submit(self, func):
928928

929929
def disconnect(self, cid):
930930
"""remove the observer with connection id *cid*"""
931-
try:
932-
del self.observers[cid]
933-
except KeyError:
934-
pass
931+
for reg in (self.change_observers, self.submit_observers):
932+
try:
933+
del reg[cid]
934+
except KeyError:
935+
pass
935936

936937

937938
class RadioButtons(AxesWidget):

0 commit comments

Comments
 (0)