[common] PySignal: allow to disconnect another signal

This commit is contained in:
Julien-Haudegond 2020-08-27 11:35:58 +02:00
parent 3e5e4cf3e9
commit 3033e79181

View file

@ -173,8 +173,8 @@ class Signal(object):
(s[slotSelf] is slot.__func__)):
self._slots.remove(s)
break
elif isinstance(slot, partial) or '<' in slot.__name__:
# If it's a partial or lambda, try to remove directly
elif isinstance(slot, (partial, Signal)) or '<' in slot.__name__:
# If it's a partial, a Signal or lambda, try to remove directly
try:
self._slots.remove(slot)
except ValueError: