From 913507fe04c3a03627e6f2b92690fe68ece54a12 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 22 Sep 2009 22:00:42 +0000 Subject: [PATCH] Fix stack_dicts() to always return a dict. svn path=/main/trunk/; revision=14389 --- pym/portage/util.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pym/portage/util.py b/pym/portage/util.py index d89f723c8..df1c1a1e4 100644 --- a/pym/portage/util.py +++ b/pym/portage/util.py @@ -216,12 +216,10 @@ def stack_dicts(dicts, incremental=0, incrementals=[], ignore_none=0): """Stacks an array of dict-types into one array. Optionally merging or overwriting matching key/value pairs for the dict[key]->string. Returns a single dict.""" - final_dict = None + final_dict = {} for mydict in dicts: if not mydict: continue - if final_dict is None: - final_dict = {} for k, v in mydict.items(): if k in final_dict and (incremental or (k in incrementals)): final_dict[k] += " " + v -- 2.26.2