summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2002-04-13 21:07:45 (GMT)
committerFred Drake <fdrake@acm.org>2002-04-13 21:07:45 (GMT)
commit88c934498696a33bd52d00c48f00c1d0a9564361 (patch)
treec938a9962591803c3ff44133cf42841ead99a2ac /Modules
parentf42d32cb27456fa244d67a36c1a7270b9421e7a4 (diff)
downloadcpython-88c934498696a33bd52d00c48f00c1d0a9564361.zip
cpython-88c934498696a33bd52d00c48f00c1d0a9564361.tar.gz
cpython-88c934498696a33bd52d00c48f00c1d0a9564361.tar.bz2
initpwd(): Clean up initialization, avoid PyModule_GetDict().
Diffstat (limited to 'Modules')
-rw-r--r--Modules/pwdmodule.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/pwdmodule.c b/Modules/pwdmodule.c
index 9656bba..eeed608 100644
--- a/Modules/pwdmodule.c
+++ b/Modules/pwdmodule.c
@@ -159,9 +159,9 @@ DL_EXPORT(void)
initpwd(void)
{
PyObject *m, *d;
- m = Py_InitModule4("pwd", pwd_methods, pwd__doc__,
- (PyObject *)NULL, PYTHON_API_VERSION);
- d = PyModule_GetDict(m);
+ m = Py_InitModule3("pwd", pwd_methods, pwd__doc__);
+
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);
}