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

Skip to content

Commit 895bd46

Browse files
committed
re-use remove_proxy in disconnect
1 parent 3e7bedb commit 895bd46

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

lib/matplotlib/cbook.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -340,17 +340,12 @@ def disconnect(self, cid):
340340
341341
No error is raised if such a callback does not exist.
342342
"""
343-
self._pickled_cids.discard(cid)
344343
for signal, proxy in self._func_cid_map:
345344
if self._func_cid_map[signal, proxy] == cid:
346345
break
347346
else: # Not found
348347
return
349-
assert self.callbacks[signal][cid] == proxy
350-
del self.callbacks[signal][cid]
351-
self._func_cid_map.pop((signal, proxy))
352-
if len(self.callbacks[signal]) == 0: # Clean up empty dicts
353-
del self.callbacks[signal]
348+
self._remove_proxy(signal, proxy)
354349

355350
def disconnect_func(self, signal, func):
356351
"""

0 commit comments

Comments
 (0)