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))