mirror of
https://github.com/python/cpython.git
synced 2025-10-17 04:08:28 +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
|
@ -1193,13 +1193,27 @@ make_flags(void)
|
|||
return seq;
|
||||
}
|
||||
|
||||
static struct PyModuleDef sysmodule = {
|
||||
PyModuleDef_HEAD_INIT,
|
||||
"sys",
|
||||
sys_doc,
|
||||
0,
|
||||
sys_methods,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
|
||||
PyObject *
|
||||
_PySys_Init(void)
|
||||
{
|
||||
PyObject *m, *v, *sysdict;
|
||||
char *s;
|
||||
|
||||
m = Py_InitModule3("sys", sys_methods, sys_doc);
|
||||
m = PyModule_Create(&sysmodule);
|
||||
if (m == NULL)
|
||||
return NULL;
|
||||
sysdict = PyModule_GetDict(m);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue