From: Zac Medico Date: Sun, 13 Aug 2006 05:35:00 +0000 (-0000) Subject: Make stack_dictlist return an empty dictionary when there is nothing to stack. See... X-Git-Tag: v2.1.1~70 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3ad8559b4158ec110665f5f8baed0d364e73e9ad;p=portage.git Make stack_dictlist return an empty dictionary when there is nothing to stack. See bug #143730. svn path=/main/trunk/; revision=4240 --- diff --git a/pym/portage_util.py b/pym/portage_util.py index e159c3766..54d221d8f 100644 --- a/pym/portage_util.py +++ b/pym/portage_util.py @@ -80,12 +80,10 @@ def stack_dictlist(original_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]->list. Returns a single dict. Higher index in lists is preferenced.""" - final_dict = None + final_dict = {} for mydict in original_dicts: if mydict is None: continue - if final_dict is None: - final_dict = {} for y in mydict.keys(): if not final_dict.has_key(y): final_dict[y] = []