Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Sleep python3 compatibility #66

Merged
merged 1 commit into from May 29, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions circuits/core/manager.py
Expand Up @@ -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


Expand Down Expand Up @@ -70,7 +70,7 @@ def extract(self):
return self.exception


class Sleep(object):
class Sleep(Iterator):

def __init__(self, seconds):
self._task = None
Expand All @@ -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
Expand Down