From 7b7c863cf76ee80982d43ce7514a81aa7af0da63 Mon Sep 17 00:00:00 2001 From: Saloua Litayem Date: Mon, 18 Apr 2016 13:58:04 +0200 Subject: [PATCH] Remove dict comprehension --- business_rules/engine.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/business_rules/engine.py b/business_rules/engine.py index 9bcf1f42..51311573 100644 --- a/business_rules/engine.py +++ b/business_rules/engine.py @@ -144,5 +144,6 @@ def fallback(*args, **kwargs): params = action.get('params') or {} method = getattr(defined_actions, method_name, fallback) actions_results[method_name] = method(**params) - return {method_name: result for method_name, result in - actions_results.iteritems() if result} + + return dict((method_name, actions_results[method_name]) for method_name + in actions_results.keys() if actions_results.get(method_name))