summaryrefslogtreecommitdiff
path: root/Modules/pwdmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/pwdmodule.c')
-rw-r--r--Modules/pwdmodule.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/Modules/pwdmodule.c b/Modules/pwdmodule.c
index 285fd9c984..9909400441 100644
--- a/Modules/pwdmodule.c
+++ b/Modules/pwdmodule.c
@@ -168,12 +168,8 @@ pwd_getpwall(PyObject *self)
struct passwd *p;
if ((d = PyList_New(0)) == NULL)
return NULL;
-#if defined(PYOS_OS2) && defined(PYCC_GCC)
- if ((p = getpwuid(0)) != NULL) {
-#else
setpwent();
while ((p = getpwent()) != NULL) {
-#endif
PyObject *v = mkpwent(p);
if (v == NULL || PyList_Append(d, v) != 0) {
Py_XDECREF(v);
@@ -220,8 +216,9 @@ PyInit_pwd(void)
return NULL;
if (!initialized) {
- PyStructSequence_InitType(&StructPwdType,
- &struct_pwd_type_desc);
+ if (PyStructSequence_InitType2(&StructPwdType,
+ &struct_pwd_type_desc) < 0)
+ return NULL;
initialized = 1;
}
Py_INCREF((PyObject *) &StructPwdType);