initpwd(): Clean up initialization, avoid PyModule_GetDict().
This commit is contained in:
parent
f42d32cb27
commit
88c9344986
@ -159,9 +159,9 @@ DL_EXPORT(void)
|
|||||||
initpwd(void)
|
initpwd(void)
|
||||||
{
|
{
|
||||||
PyObject *m, *d;
|
PyObject *m, *d;
|
||||||
m = Py_InitModule4("pwd", pwd_methods, pwd__doc__,
|
m = Py_InitModule3("pwd", pwd_methods, pwd__doc__);
|
||||||
(PyObject *)NULL, PYTHON_API_VERSION);
|
|
||||||
d = PyModule_GetDict(m);
|
|
||||||
PyStructSequence_InitType(&StructPwdType, &struct_pwd_type_desc);
|
PyStructSequence_InitType(&StructPwdType, &struct_pwd_type_desc);
|
||||||
PyDict_SetItemString(d, "struct_pwent", (PyObject *) &StructPwdType);
|
Py_INCREF((PyObject *) &StructPwdType);
|
||||||
|
PyModule_AddObject(m, "struct_pwent", (PyObject *) &StructPwdType);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user