Skip to content

Commit

Permalink
bpo-38823: Clean up refleaks in _asyncio initialization. (GH-17195)
Browse files Browse the repository at this point in the history
https://bugs.python.org/issue38823
(cherry picked from commit c3f6bdc)

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
  • Loading branch information
miss-islington and brandtbucher authored Nov 16, 2019
1 parent 5469bc0 commit 825e91b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Modules/_asynciomodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -3361,24 +3361,28 @@ PyInit__asyncio(void)
Py_INCREF(&FutureType);
if (PyModule_AddObject(m, "Future", (PyObject *)&FutureType) < 0) {
Py_DECREF(&FutureType);
Py_DECREF(m);
return NULL;
}

Py_INCREF(&TaskType);
if (PyModule_AddObject(m, "Task", (PyObject *)&TaskType) < 0) {
Py_DECREF(&TaskType);
Py_DECREF(m);
return NULL;
}

Py_INCREF(all_tasks);
if (PyModule_AddObject(m, "_all_tasks", all_tasks) < 0) {
Py_DECREF(all_tasks);
Py_DECREF(m);
return NULL;
}

Py_INCREF(current_tasks);
if (PyModule_AddObject(m, "_current_tasks", current_tasks) < 0) {
Py_DECREF(current_tasks);
Py_DECREF(m);
return NULL;
}

Expand Down

0 comments on commit 825e91b

Please sign in to comment.