Make stack_dictlist return an empty dictionary when there is nothing to stack. See...
authorZac Medico <zmedico@gentoo.org>
Sun, 13 Aug 2006 05:35:00 +0000 (05:35 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 13 Aug 2006 05:35:00 +0000 (05:35 -0000)
svn path=/main/trunk/; revision=4240

pym/portage_util.py

index e159c37661b85d27e1051f96d8fef0aee05ed028..54d221d8fcb232db980cdb2d287dc80748b8656e 100644 (file)
@@ -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] = []