Commits

Denis Bilenko committed ac1b189

use getcurrent directly and not through the module

Comments (0)

Files changed (1)

         """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)
         """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)
         """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: