diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-05-09 15:52:27 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-05-09 15:52:27 (GMT) |
commit | f95a1b3c53bdd678b64aa608d4375660033460c3 (patch) | |
tree | a8bee40b1b14e28ff5978ea519f3035a3c399912 /Modules/grpmodule.c | |
parent | bd250300191133d276a71b395b6428081bf825b8 (diff) | |
download | cpython-f95a1b3c53bdd678b64aa608d4375660033460c3.zip cpython-f95a1b3c53bdd678b64aa608d4375660033460c3.tar.gz cpython-f95a1b3c53bdd678b64aa608d4375660033460c3.tar.bz2 |
Recorded merge of revisions 81029 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines
Untabify C files. Will watch buildbots.
........
Diffstat (limited to 'Modules/grpmodule.c')
-rw-r--r-- | Modules/grpmodule.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/Modules/grpmodule.c b/Modules/grpmodule.c index 912d139..d10a79d 100644 --- a/Modules/grpmodule.c +++ b/Modules/grpmodule.c @@ -10,8 +10,8 @@ static PyStructSequence_Field struct_group_type_fields[] = { {"gr_name", "group name"}, {"gr_passwd", "password"}, - {"gr_gid", "group id"}, - {"gr_mem", "group memebers"}, + {"gr_gid", "group id"}, + {"gr_mem", "group memebers"}, {0} }; @@ -64,10 +64,10 @@ mkgrent(struct group *p) Py_INCREF(Py_None); #else if (p->gr_passwd) - SET(setIndex++, PyUnicode_DecodeFSDefault(p->gr_passwd)); + SET(setIndex++, PyUnicode_DecodeFSDefault(p->gr_passwd)); else { - SET(setIndex++, Py_None); - Py_INCREF(Py_None); + SET(setIndex++, Py_None); + Py_INCREF(Py_None); } #endif SET(setIndex++, PyLong_FromLong((long) p->gr_gid)); @@ -91,12 +91,12 @@ grp_getgrgid(PyObject *self, PyObject *pyo_id) py_int_id = PyNumber_Long(pyo_id); if (!py_int_id) - return NULL; + return NULL; gid = PyLong_AS_LONG(py_int_id); Py_DECREF(py_int_id); if ((p = getgrgid(gid)) == NULL) { - PyErr_Format(PyExc_KeyError, "getgrgid(): gid not found: %d", gid); + PyErr_Format(PyExc_KeyError, "getgrgid(): gid not found: %d", gid); return NULL; } return mkgrent(p); @@ -116,9 +116,9 @@ grp_getgrnam(PyObject *self, PyObject *args) return NULL; if (PyBytes_AsStringAndSize(bytes, &name, NULL) == -1) goto out; - + if ((p = getgrnam(name)) == NULL) { - PyErr_Format(PyExc_KeyError, "getgrnam(): name not found: %s", name); + PyErr_Format(PyExc_KeyError, "getgrnam(): name not found: %s", name); goto out; } retval = mkgrent(p); @@ -151,18 +151,18 @@ grp_getgrall(PyObject *self, PyObject *ignore) } static PyMethodDef grp_methods[] = { - {"getgrgid", grp_getgrgid, METH_O, + {"getgrgid", grp_getgrgid, METH_O, "getgrgid(id) -> tuple\n\ Return the group database entry for the given numeric group ID. If\n\ id is not valid, raise KeyError."}, - {"getgrnam", grp_getgrnam, METH_VARARGS, + {"getgrnam", grp_getgrnam, METH_VARARGS, "getgrnam(name) -> tuple\n\ Return the group database entry for the given group name. If\n\ name is not valid, raise KeyError."}, - {"getgrall", grp_getgrall, METH_NOARGS, + {"getgrall", grp_getgrall, METH_NOARGS, "getgrall() -> list of tuples\n\ Return a list of all available group entries, in arbitrary order."}, - {NULL, NULL} /* sentinel */ + {NULL, NULL} /* sentinel */ }; PyDoc_STRVAR(grp__doc__, @@ -184,15 +184,15 @@ complete membership information.)"); static struct PyModuleDef grpmodule = { - PyModuleDef_HEAD_INIT, - "grp", - grp__doc__, - -1, - grp_methods, - NULL, - NULL, - NULL, - NULL + PyModuleDef_HEAD_INIT, + "grp", + grp__doc__, + -1, + grp_methods, + NULL, + NULL, + NULL, + NULL }; PyMODINIT_FUNC @@ -204,7 +204,7 @@ PyInit_grp(void) return NULL; d = PyModule_GetDict(m); if (!initialized) - PyStructSequence_InitType(&StructGrpType, &struct_group_type_desc); + PyStructSequence_InitType(&StructGrpType, &struct_group_type_desc); PyDict_SetItemString(d, "struct_group", (PyObject *) &StructGrpType); initialized = 1; return m; |