python / asyncio

asyncio historical repository
https://docs.python.org/3/library/asyncio.html
1.04k stars 177 forks source link

make CoroWrapper.throw fully compatible with gen.throw #430

Closed Martiusweb closed 7 years ago

Martiusweb commented 7 years ago

Following #429, this PR makes the signature of CoroWrapper.throw compatible with gen.throw.

The signature of gen.throw is the same in python 3.3 - 3.5. Unless I'm missing something, the patch shouldn't change anything for the current implementation of asyncio, since throw is only called explicitly in Task: https://github.com/python/asyncio/blob/master/asyncio/tasks.py#L241

gvanrossum commented 7 years ago

Since the CoroWrapper class tries to emulate a regular coroutine/generator object I agree that this should be considered a bugfix. Can you add a unittest?

gvanrossum commented 7 years ago

Thanks! Looking forward to more from you.