From fc3559e5c705beaef2e3e206085c9681d47d8a4b Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Wed, 13 Jan 2016 00:10:06 +0000 Subject: [PATCH] Fix up the HDict iterator. --- volatility/framework/interfaces/configuration.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/volatility/framework/interfaces/configuration.py b/volatility/framework/interfaces/configuration.py index 5ba244c0a..b30a29cfa 100644 --- a/volatility/framework/interfaces/configuration.py +++ b/volatility/framework/interfaces/configuration.py @@ -100,15 +100,15 @@ class HierarchicalDict(collections.Mapping): def __iter__(self): """Returns an iterator object that supports the iterator protocol""" - return self + return self.generator() - def __next__(self): + def generator(self): """Yields the next element in the iterator""" for key in self._data: yield key - for subdict in self._subdict: - for key in subdict: - yield key + for subdict_key in self._subdict: + for key in self._subdict[subdict_key]: + yield subdict_key + self.separator + key def __getitem__(self, key): """Gets an item, traversing down the trees to get to the final value"""