diff options
Diffstat (limited to 'pym/cache')
-rw-r--r-- | pym/cache/template.py | 2 | ||||
-rw-r--r-- | pym/cache/util.py | 7 |
2 files changed, 3 insertions, 6 deletions
diff --git a/pym/cache/template.py b/pym/cache/template.py index 4ffd9b9ef..d19bb8892 100644 --- a/pym/cache/template.py +++ b/pym/cache/template.py @@ -151,7 +151,7 @@ class database(object): if key not in self.__known_keys: raise InvalidRestriction(key, match, "Key isn't valid") - for cpv in self.keys(): + for cpv in self.iterkeys(): cont = True vals = self[cpv] for key, match in restricts.iteritems(): diff --git a/pym/cache/util.py b/pym/cache/util.py index ac09c132c..0e81a399f 100644 --- a/pym/cache/util.py +++ b/pym/cache/util.py @@ -18,8 +18,7 @@ def mirror_cache(valid_nodes_iterable, src_cache, trg_cache, eclass_cache=None, else: noise=verbose_instance - dead_nodes = {} - dead_nodes = dict.fromkeys(trg_cache.keys()) + dead_nodes = set(trg_cache.iterkeys()) count=0 if not trg_cache.autocommits: @@ -28,8 +27,7 @@ def mirror_cache(valid_nodes_iterable, src_cache, trg_cache, eclass_cache=None, for x in valid_nodes_iterable: # print "processing x=",x count+=1 - if dead_nodes.has_key(x): - del dead_nodes[x] + dead_nodes.discard(x) try: entry = src_cache[x] except KeyError, e: noise.missing_entry(x) @@ -105,7 +103,6 @@ def mirror_cache(valid_nodes_iterable, src_cache, trg_cache, eclass_cache=None, except cache_errors.CacheError, ce: noise.exception(ce) del ce - dead_nodes.clear() noise.finish() |