summaryrefslogtreecommitdiffstats
path: root/Modules/_collectionsmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_collectionsmodule.c')
-rw-r--r--Modules/_collectionsmodule.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c
index db07537..02ffb56 100644
--- a/Modules/_collectionsmodule.c
+++ b/Modules/_collectionsmodule.c
@@ -1348,31 +1348,44 @@ PyDoc_STRVAR(module_doc,
- defaultdict: dict subclass with a default value factory\n\
");
+
+static struct PyModuleDef _collectionsmodule = {
+ PyModuleDef_HEAD_INIT,
+ "_collections",
+ module_doc,
+ -1,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
PyMODINIT_FUNC
-init_collections(void)
+PyInit__collections(void)
{
PyObject *m;
- m = Py_InitModule3("_collections", NULL, module_doc);
+ m = PyModule_Create(&_collectionsmodule);
if (m == NULL)
- return;
+ return NULL;
if (PyType_Ready(&deque_type) < 0)
- return;
+ return NULL;
Py_INCREF(&deque_type);
PyModule_AddObject(m, "deque", (PyObject *)&deque_type);
defdict_type.tp_base = &PyDict_Type;
if (PyType_Ready(&defdict_type) < 0)
- return;
+ return NULL;
Py_INCREF(&defdict_type);
PyModule_AddObject(m, "defaultdict", (PyObject *)&defdict_type);
if (PyType_Ready(&dequeiter_type) < 0)
- return;
+ return NULL;
if (PyType_Ready(&dequereviter_type) < 0)
- return;
+ return NULL;
- return;
+ return m;
}