Commit 5fef0b6b authored by Denis Bilenko's avatar Denis Bilenko

Group: allow adding greenlets without 'rawlink' method (like MAIN)

parent 247ebba3
......@@ -56,7 +56,12 @@ class Group(object):
return iter(self.greenlets)
def add(self, greenlet):
greenlet.rawlink(self.discard)
try:
rawlink = greenlet.rawlink
except AttributeError:
pass # non-Greenlet greenlet, like MAIN
else:
rawlink(self.discard)
self.greenlets.add(greenlet)
self._empty_event.clear()
......
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