api.kill: support greenlet.throw's arguments
This commit is contained in:
@@ -276,8 +276,8 @@ def spawn(function, *args, **kwds):
|
|||||||
g.switch(function, args, kwds, t.cancel)
|
g.switch(function, args, kwds, t.cancel)
|
||||||
return g
|
return g
|
||||||
|
|
||||||
def kill(g):
|
def kill(g, *throw_args):
|
||||||
get_hub().schedule_call(0, g.throw)
|
get_hub().schedule_call(0, g.throw, *throw_args)
|
||||||
if getcurrent() is not get_hub().greenlet:
|
if getcurrent() is not get_hub().greenlet:
|
||||||
sleep(0)
|
sleep(0)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user