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): ...@@ -324,7 +324,6 @@ def with_timeout(seconds, func, *args, **kwds):
timeout.cancel() timeout.cancel()
def signal(signalnum, handler, *args, **kwargs): def signal(signalnum, handler, *args, **kwargs):
def deliver_exception_to_MAIN(): def deliver_exception_to_MAIN():
try: try:
...@@ -374,6 +373,9 @@ class Waiter(object): ...@@ -374,6 +373,9 @@ class Waiter(object):
waiting = '' waiting = ''
return '<%s%s greenlet=%s>' % (type(self).__name__, waiting, self.greenlet) return '<%s%s greenlet=%s>' % (type(self).__name__, waiting, self.greenlet)
def __nonzero__(self):
return self.greenlet is not None
@property @property
def waiting(self): def waiting(self):
return self.greenlet is not None return self.greenlet is not None
...@@ -411,7 +413,6 @@ class Waiter(object): ...@@ -411,7 +413,6 @@ class Waiter(object):
self.greenlet = None self.greenlet = None
def get_hub(): def get_hub():
global _threadlocal global _threadlocal
try: 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