Visitar URL original
gh-100344: Provide C implementation for asyncio.current_task by itamaro · Pull Request #100345 · python/cpython · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Revert optimizations in Python implementation of asyncio.current_task
  • Loading branch information
itamaro committed Dec 22, 2022
commit 391db59ca8cabcba9b8ba20ee0ea83e6613ccb7b
5 changes: 1 addition & 4 deletions Lib/asyncio/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ def current_task(loop=None):
"""Return a currently executed task."""
if loop is None:
loop = events.get_running_loop()
try:
return _current_tasks[loop]
except KeyError:
return None
return _current_tasks.get(loop)


def all_tasks(loop=None):
Expand Down