Commit 18e77803 authored by Denis Bilenko's avatar Denis Bilenko

move _NONE from timeout to hub

parent f157b319
......@@ -272,3 +272,12 @@ class Waiter(object):
# can also have a debugging version, that wraps the value in a tuple (self, value) in switch()
# and unwraps it in wait() thus checking that switch() was indeed called
class _NONE(object):
"A special thingy you must never pass to any of gevent API"
__slots__ = []
def __repr__(self):
return '<_NONE>'
_NONE = _NONE()
......@@ -14,7 +14,7 @@ to arbitrary code.
"""
from gevent import core
from gevent.hub import getcurrent
from gevent.hub import getcurrent, _NONE
__all__ = ['Timeout',
'with_timeout']
......@@ -197,11 +197,3 @@ def with_timeout(seconds, function, *args, **kwds):
finally:
timeout.cancel()
class _NONE(object):
__slots__ = []
def __repr__(self):
return '<_NONE>'
_NONE = _NONE()
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