summaryrefslogtreecommitdiffstats
path: root/Modules/_asynciomodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_asynciomodule.c')
-rw-r--r--Modules/_asynciomodule.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c
index d394002..fa94a65 100644
--- a/Modules/_asynciomodule.c
+++ b/Modules/_asynciomodule.c
@@ -3391,9 +3391,6 @@ PyInit__asyncio(void)
if (module_init() < 0) {
return NULL;
}
- if (PyType_Ready(&FutureType) < 0) {
- return NULL;
- }
if (PyType_Ready(&FutureIterType) < 0) {
return NULL;
}
@@ -3403,9 +3400,6 @@ PyInit__asyncio(void)
if (PyType_Ready(&TaskWakeupMethWrapper_Type) < 0) {
return NULL;
}
- if (PyType_Ready(&TaskType) < 0) {
- return NULL;
- }
if (PyType_Ready(&PyRunningLoopHolder_Type) < 0) {
return NULL;
}
@@ -3415,16 +3409,13 @@ PyInit__asyncio(void)
return NULL;
}
- Py_INCREF(&FutureType);
- if (PyModule_AddObject(m, "Future", (PyObject *)&FutureType) < 0) {
- Py_DECREF(&FutureType);
+ /* FutureType and TaskType are made ready by PyModule_AddType() calls below. */
+ if (PyModule_AddType(m, &FutureType) < 0) {
Py_DECREF(m);
return NULL;
}
- Py_INCREF(&TaskType);
- if (PyModule_AddObject(m, "Task", (PyObject *)&TaskType) < 0) {
- Py_DECREF(&TaskType);
+ if (PyModule_AddType(m, &TaskType) < 0) {
Py_DECREF(m);
return NULL;
}