support break in iterator

This commit is contained in:
Emmanuel Garette 2013-03-25 14:21:30 +01:00
parent 39c8e2eb0b
commit 4f3db9cbc6
1 changed files with 6 additions and 0 deletions

View File

@ -378,6 +378,8 @@ class Config(object):
if not isinstance(child, OptionDescription):
try:
yield child._name, getattr(self, child._name)
except GeneratorExit:
raise StopIteration
except:
pass # option with properties
@ -387,6 +389,8 @@ class Config(object):
for child in self._cfgimpl_descr._children:
try:
yield child._name, getattr(self, child._name)
except GeneratorExit:
raise StopIteration
except:
pass # option with properties
@ -411,6 +415,8 @@ class Config(object):
yield child._name, getattr(self, child._name)
else:
yield child._name, getattr(self, child._name)
except GeneratorExit:
raise StopIteration
except:
pass
# ______________________________________________________________________