[issue36403] AsyncIterator on 3.7: __aiter__ no longer honors finally blocks

Ask Solem report at bugs.python.org
Sat Mar 23 01:35:34 EDT 2019


Ask Solem <ask at celeryproject.org> added the comment:

Ah, so the extra call_soon means it needs a:

[code]
loop.run_until_complete(asyncio.sleep(0))```
[/code]

before the self.assertTrue(it.finally_executed)

to finish executing agen.close().

Why is create_task different? Does it execute an iteration of the generator immediately?

Seems good for this behavior to be consistent, but not sure how difficult that would be.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36403>
_______________________________________


More information about the Python-bugs-list mailing list