Skip to content

Fix issue with async's do_map which wasn't awaiting any func's that are coroutines#913

Merged
mitsuhiko merged 1 commit intopallets:masterfrom
seaders:do_map_async_fix
Feb 18, 2019
Merged

Fix issue with async's do_map which wasn't awaiting any func's that are coroutines#913
mitsuhiko merged 1 commit intopallets:masterfrom
seaders:do_map_async_fix

Conversation

@seaders
Copy link
Copy Markdown
Contributor

@seaders seaders commented Oct 17, 2018

While working on the async version of a new applymacro filter, I noticed an underlying issue with map, applying other async filters. In its iteration, it needed to check whether the return value is a coroutine, and if so wait for it.

The added test, test_map_sum passes when in non-async mode, but without this fix, fails in the async tests.

@mitsuhiko
Copy link
Copy Markdown
Contributor

I suppose the better fix would be to use auto_await which internally uses coroutine.isawaitable which is how the compiler makes a similar decision.

@seaders
Copy link
Copy Markdown
Contributor Author

seaders commented Feb 18, 2019

@mitsuhiko changed to use that (when I PR'd this initially, I wasn't even aware that that function was in the project).

@mitsuhiko mitsuhiko merged commit 2b23cca into pallets:master Feb 18, 2019
@seaders seaders mentioned this pull request Oct 31, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants