summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Peuch <cortex@worlddomination.be>2019-11-28 16:24:13 +0100
committerLaurent Peuch <cortex@worlddomination.be>2019-11-28 16:24:13 +0100
commit9daf7a72d6555c3f27e577d45b136e95652755e8 (patch)
tree73b3fc26c0f38d52dfe3d14f974d860710be53bf
parent5538719c5fae85c89ca9ab839b4fa38221b8e3a0 (diff)
downloadlogilab-common-9daf7a72d6555c3f27e577d45b136e95652755e8.tar.gz
[registry/fix] re-put "winner" key in registry._select_best debug information
-rw-r--r--logilab/common/registry.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/logilab/common/registry.py b/logilab/common/registry.py
index 7820689..27b72b6 100644
--- a/logilab/common/registry.py
+++ b/logilab/common/registry.py
@@ -410,7 +410,7 @@ class Registry(dict):
An optional argument `debug_callback` can be passed, it will be called
once the selection is done and will return a dict of the following form::
- {"all_objects": [], "end_score": 0, "winners": [],
+ {"all_objects": [], "end_score": 0, "winners": [], "winner": None or winner,
"self": self, "args": args, "kwargs": kwargs, }
"""
@@ -440,6 +440,7 @@ class Registry(dict):
if debug_callback:
debug_registry_select_best["winners"] = winners.copy() if winners else []
+ debug_registry_select_best["winner"] = winners[0] if winners else winners
debug_registry_select_best["end_score"] = score
debug_callback(debug_registry_select_best)