mirror of https://github.com/python/cpython
bpo-38823: Clean up refleaks in _asyncio initialization. (GH-17195)
https://bugs.python.org/issue38823
This commit is contained in:
parent
d0acdfcf34
commit
c3f6bdc332
|
@ -3387,24 +3387,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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue