summaryrefslogtreecommitdiffstats
path: root/Python/bltinmodule.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2008-06-11 05:26:20 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2008-06-11 05:26:20 (GMT)
commit1a21451b1d73b65af949193208372e86bf308411 (patch)
tree8e98d7be9e249b011ae9380479656e5284ec0234 /Python/bltinmodule.c
parentcdf94635d7e364f9ce1905bafa5b540f4d16147c (diff)
downloadcpython-1a21451b1d73b65af949193208372e86bf308411.zip
cpython-1a21451b1d73b65af949193208372e86bf308411.tar.gz
cpython-1a21451b1d73b65af949193208372e86bf308411.tar.bz2
Implement PEP 3121: new module initialization and finalization API.
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r--Python/bltinmodule.c17
1 files changed, 14 insertions, 3 deletions
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 @@ PyDoc_STRVAR(builtin_doc,
\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);