support break in iterator
This commit is contained in:
parent
39c8e2eb0b
commit
4f3db9cbc6
|
@ -378,6 +378,8 @@ class Config(object):
|
||||||
if not isinstance(child, OptionDescription):
|
if not isinstance(child, OptionDescription):
|
||||||
try:
|
try:
|
||||||
yield child._name, getattr(self, child._name)
|
yield child._name, getattr(self, child._name)
|
||||||
|
except GeneratorExit:
|
||||||
|
raise StopIteration
|
||||||
except:
|
except:
|
||||||
pass # option with properties
|
pass # option with properties
|
||||||
|
|
||||||
|
@ -387,6 +389,8 @@ class Config(object):
|
||||||
for child in self._cfgimpl_descr._children:
|
for child in self._cfgimpl_descr._children:
|
||||||
try:
|
try:
|
||||||
yield child._name, getattr(self, child._name)
|
yield child._name, getattr(self, child._name)
|
||||||
|
except GeneratorExit:
|
||||||
|
raise StopIteration
|
||||||
except:
|
except:
|
||||||
pass # option with properties
|
pass # option with properties
|
||||||
|
|
||||||
|
@ -411,6 +415,8 @@ class Config(object):
|
||||||
yield child._name, getattr(self, child._name)
|
yield child._name, getattr(self, child._name)
|
||||||
else:
|
else:
|
||||||
yield child._name, getattr(self, child._name)
|
yield child._name, getattr(self, child._name)
|
||||||
|
except GeneratorExit:
|
||||||
|
raise StopIteration
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
# ______________________________________________________________________
|
# ______________________________________________________________________
|
||||||
|
|
Loading…
Reference in New Issue