mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Implement PEP 3121: new module initialization and finalization API.
This commit is contained in:
parent
cdf94635d7
commit
1a21451b1d
113 changed files with 2230 additions and 855 deletions
|
@ -42,8 +42,21 @@ static PyMethodDef crypt_methods[] = {
|
|||
{NULL, NULL} /* sentinel */
|
||||
};
|
||||
|
||||
|
||||
static struct PyModuleDef cryptmodule = {
|
||||
PyModuleDef_HEAD_INIT,
|
||||
"crypt",
|
||||
NULL,
|
||||
-1,
|
||||
crypt_methods,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
PyMODINIT_FUNC
|
||||
initcrypt(void)
|
||||
PyInit_crypt(void)
|
||||
{
|
||||
Py_InitModule("crypt", crypt_methods);
|
||||
return PyModule_Create(&cryptmodule);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue