未验证 提交 e26a66d8 编写于 作者: C Cleber Rosa

Merge remote-tracking branch 'clebergnu/pep479'

Signed-off-by: NCleber Rosa <crosa@redhat.com>
......@@ -274,7 +274,7 @@ class TreeNode(object):
node = self.parent
while True:
if node is None:
raise StopIteration
return
yield node
node = node.parent
......
......@@ -73,7 +73,7 @@ class MuxTree(object):
try:
node = queue.popleft()
except IndexError:
raise StopIteration
return
def __iter__(self):
"""
......@@ -101,7 +101,10 @@ class MuxTree(object):
pools.append([pool])
variants = itertools.product(*pools)
while True:
yield list(itertools.chain(*next(variants)))
try:
yield list(itertools.chain(*next(variants)))
except StopIteration:
return
@staticmethod
def _valid_variant(variant):
......@@ -310,7 +313,6 @@ class ValueDict(dict): # only container pylint: disable=R0903
""" Slower implementation with the use of __getitem__ """
for key in iterkeys(self):
yield key, self[key]
raise StopIteration
class Control(object): # Few methods pylint: disable=R0903
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册