From: Zac Medico Date: Tue, 22 Sep 2009 22:00:42 +0000 (-0000) Subject: Fix stack_dicts() to always return a dict. X-Git-Tag: v2.2_rc42~35 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=913507fe04c3a03627e6f2b92690fe68ece54a12;p=portage.git Fix stack_dicts() to always return a dict. svn path=/main/trunk/; revision=14389 --- 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