Commit b00ff454 authored by Denis Bilenko's avatar Denis Bilenko

greenlet.Waiter: add __nonzero__

parent 49165703
......@@ -324,7 +324,6 @@ def with_timeout(seconds, func, *args, **kwds):
timeout.cancel()
def signal(signalnum, handler, *args, **kwargs):
def deliver_exception_to_MAIN():
try:
......@@ -374,6 +373,9 @@ class Waiter(object):
waiting = ''
return '<%s%s greenlet=%s>' % (type(self).__name__, waiting, self.greenlet)
def __nonzero__(self):
return self.greenlet is not None
@property
def waiting(self):
return self.greenlet is not None
......@@ -411,7 +413,6 @@ class Waiter(object):
self.greenlet = None
def get_hub():
global _threadlocal
try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment