mirror of
https://github.com/python/cpython.git
synced 2025-10-14 02:43:49 +00:00
gh-128552: fix refcycles in eager task creation (#128553)
This commit is contained in:
parent
6ea04da270
commit
61b9811ac6
4 changed files with 71 additions and 6 deletions
|
@ -477,7 +477,12 @@ class BaseEventLoop(events.AbstractEventLoop):
|
|||
|
||||
task.set_name(name)
|
||||
|
||||
return task
|
||||
try:
|
||||
return task
|
||||
finally:
|
||||
# gh-128552: prevent a refcycle of
|
||||
# task.exception().__traceback__->BaseEventLoop.create_task->task
|
||||
del task
|
||||
|
||||
def set_task_factory(self, factory):
|
||||
"""Set a task factory that will be used by loop.create_task().
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue