diff options
Diffstat (limited to 'Modules/pwdmodule.c')
-rw-r--r-- | Modules/pwdmodule.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/pwdmodule.c b/Modules/pwdmodule.c index 35afc4e..91989b7 100644 --- a/Modules/pwdmodule.c +++ b/Modules/pwdmodule.c @@ -128,8 +128,12 @@ pwd_getpwall(PyObject *self, PyObject *args) return NULL; 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); |