python 3.5 support
[tiramisu.git] / tiramisu / config.py
index cc61b29..5a63346 100644 (file)
@@ -168,7 +168,10 @@ class SubConfig(object):
                     yield name, self.getattr(name,
                                              force_permissive=force_permissive)
                 except GeneratorExit:  # pragma: optional cover
-                    raise StopIteration
+                    if sys.version_info[0] < 3:
+                        raise StopIteration
+                    else:
+                        raise GeneratorExit()
                 except PropertiesOptionError:  # pragma: optional cover
                     pass  # option with properties
 
@@ -180,7 +183,10 @@ class SubConfig(object):
                 yield child.impl_getname(), self.getattr(child.impl_getname(),
                                                          force_permissive=force_permissive)
             except GeneratorExit:  # pragma: optional cover
-                raise StopIteration
+                if sys.version_info[0] < 3:
+                    raise StopIteration
+                else:
+                    raise GeneratorExit()
             except PropertiesOptionError:  # pragma: optional cover
                 pass  # option with properties
 
@@ -206,7 +212,10 @@ class SubConfig(object):
                         name = child.impl_getname()
                         yield name, self.getattr(name, force_permissive=force_permissive)
                 except GeneratorExit:  # pragma: optional cover
-                    raise StopIteration
+                    if sys.version_info[0] < 3:
+                        raise StopIteration
+                    else:
+                        raise GeneratorExit()
                 except PropertiesOptionError:  # pragma: optional cover
                     pass
     # ______________________________________________________________________