diff --git a/circuits/core/manager.py b/circuits/core/manager.py index bd7e633c9..dda92e359 100644 --- a/circuits/core/manager.py +++ b/circuits/core/manager.py @@ -35,7 +35,7 @@ from .values import Value from ..tools import tryimport from .handlers import handler -from ..six import create_bound_method, next +from ..six import create_bound_method, next, Iterator from .events import exception, generate_events, signal, started, stopped, Event @@ -70,7 +70,7 @@ def extract(self): return self.exception -class Sleep(object): +class Sleep(Iterator): def __init__(self, seconds): self._task = None @@ -86,7 +86,7 @@ def __iter__(self): def __repr__(self): return "sleep({0:s})".format(repr(self.expiry - time())) - def next(self): + def __next__(self): if time() >= self.expiry: raise StopIteration() return self