trun_hook: no more than one plugin shall return a result - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 6fb85f95bf0d0e2b66e424461683565360189331 DIR parent e2717284eb01826f2251a8f91f8f0d2a2b06ab35 HTML Author: ThomasV <thomasv@gitorious> Date: Thu, 10 Jul 2014 17:27:54 +0200 run_hook: no more than one plugin shall return a result Diffstat: M lib/plugins.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- DIR diff --git a/lib/plugins.py b/lib/plugins.py t@@ -51,9 +51,12 @@ def run_hook(name, *args): print_error("Plugin error") traceback.print_exc(file=sys.stdout) - results.append((p.name,r)) + if r: + results.append(r) - return results + if results: + assert len(results) == 1, results + return results[0]