Implement PEP 3121: new module initialization and finalization API.
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 6ad8d66..73a95a6 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -2231,13 +2231,24 @@
\n\
Noteworthy: None is the `nil' object; Ellipsis represents `...' in slices.");
+static struct PyModuleDef builtinsmodule = {
+ PyModuleDef_HEAD_INIT,
+ "builtins",
+ builtin_doc,
+ 0,
+ builtin_methods,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+
PyObject *
_PyBuiltin_Init(void)
{
PyObject *mod, *dict, *debug;
- mod = Py_InitModule4("builtins", builtin_methods,
- builtin_doc, (PyObject *)NULL,
- PYTHON_API_VERSION);
+ mod = PyModule_Create(&builtinsmodule);
if (mod == NULL)
return NULL;
dict = PyModule_GetDict(mod);