Skip to content

Commit 77c2e93

Browse files
Renamed a few variables in examples/asyncio-prompt.py
1 parent b607be5 commit 77c2e93

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

examples/asyncio-prompt.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ async def interactive_shell():
6161

6262

6363
def main():
64-
shell = loop.create_task(interactive_shell())
65-
66-
# This gathers all the async calls, so they can be cancelled at once
67-
tasks = asyncio.gather(print_counter(), return_exceptions=True)
68-
69-
loop.run_until_complete(shell)
70-
tasks.cancel()
71-
loop.run_until_complete(tasks)
64+
shell_task = loop.create_task(interactive_shell())
65+
66+
# Gather all the async calls, so they can be cancelled at once
67+
background_task = asyncio.gather(print_counter(), return_exceptions=True)
68+
69+
loop.run_until_complete(shell_task)
70+
background_task.cancel()
71+
loop.run_until_complete(background_task)
7272
print('Qutting event loop. Bye.')
7373
loop.close()
7474

0 commit comments

Comments
 (0)