From d4ce9599c9fad460f7a5f5a6c7c86e7e463cb81d Mon Sep 17 00:00:00 2001 From: Eugene Toder Date: Tue, 13 Oct 2020 19:48:19 -0400 Subject: [PATCH] Fix await vs yield in the example --- docs/guide/coroutines.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guide/coroutines.rst b/docs/guide/coroutines.rst index aa8f62896..795631bf7 100644 --- a/docs/guide/coroutines.rst +++ b/docs/guide/coroutines.rst @@ -232,11 +232,11 @@ immediately, so you can start another operation before waiting. # This is equivalent to asyncio.ensure_future() (both work in Tornado). fetch_future = convert_yielded(self.fetch_next_chunk()) while True: - chunk = yield fetch_future + chunk = await fetch_future if chunk is None: break self.write(chunk) fetch_future = convert_yielded(self.fetch_next_chunk()) - yield self.flush() + await self.flush() .. testoutput:: :hide: -- 2.47.2