Commit 4dab5823 authored by Denis Bilenko's avatar Denis Bilenko

use getcurrent directly and not through the module

parent de4c6913
......@@ -237,7 +237,7 @@ class Waiter(object):
"""Wake up the greenlet that is calling wait() currently (if there is one).
Can only be called from Hub's greenlet.
"""
assert greenlet.getcurrent() is get_hub(), "Can only use Waiter.switch method from the mainloop"
assert getcurrent() is get_hub(), "Can only use Waiter.switch method from the mainloop"
if self.greenlet is not None:
try:
self.greenlet.switch(value)
......@@ -248,7 +248,7 @@ class Waiter(object):
"""Make greenlet calling wait() wake up (if there is a wait()).
Can only be called from Hub's greenlet.
"""
assert greenlet.getcurrent() is get_hub(), "Can only use Waiter.switch method from the mainloop"
assert getcurrent() is get_hub(), "Can only use Waiter.switch method from the mainloop"
if self.greenlet is not None:
try:
self.greenlet.throw(*throw_args)
......@@ -260,7 +260,7 @@ class Waiter(object):
"""Wait until switch() or throw() is called.
"""
assert self.greenlet is None, 'This Waiter is already used by %r' % (self.greenlet, )
self.greenlet = greenlet.getcurrent()
self.greenlet = getcurrent()
try:
return get_hub().switch()
finally:
......
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