Support *args in fire() too.

pull/35/head
David Wilson 7 years ago
parent de91f9ef7a
commit ca3fdc3fa9

@ -96,9 +96,9 @@ def listen(obj, name, func):
signals.setdefault(name, []).append(func) signals.setdefault(name, []).append(func)
def fire(obj, name, **kwargs): def fire(obj, name, *args, **kwargs):
signals = vars(obj).get('_signals', {}) signals = vars(obj).get('_signals', {})
return [func(**kwargs) for func in signals.get(name, ())] return [func(*args, **kwargs) for func in signals.get(name, ())]
def set_cloexec(fd): def set_cloexec(fd):

Loading…
Cancel
Save