Skip to content

Commit

Permalink
fix grammar in all_tasks comments
Browse files Browse the repository at this point in the history
  • Loading branch information
itamaro committed May 1, 2023
1 parent 0101742 commit b83ed94
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Lib/asyncio/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,14 @@ def all_tasks(loop=None):
"""Return a set of all tasks for the loop."""
if loop is None:
loop = events.get_running_loop()
# capturing the set of eager tasks first, so if an eager task "graduates" to
# a regular task in another thread, we don't risk missing it
# capturing the set of eager tasks first, so if an eager task "graduates"
# to a regular task in another thread, we don't risk missing it.
eager_tasks = list(_eager_tasks)
# Looping over the weak set isn't safe as it can be updated from another thread,
# therefore we cast to lists prior to filtering. The list cast itself requires
# iteration, so we repeat it several times ignoring RuntimeErrors (which are not
# very likely to occur). See issues 34970 and 36607 for details.
# Looping over the WeakSet isn't safe as it can be updated from another
# thread, therefore we cast it to list prior to filtering. The list cast
# itself requires iteration, so we repeat it several times ignoring
# RuntimeErrors (which are not very likely to occur).
# See issues 34970 and 36607 for details.
scheduled_tasks = None
i = 0
while True:
Expand Down

0 comments on commit b83ed94

Please sign in to comment.