mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Use getargs() function.
This commit is contained in:
parent
550fbcc2aa
commit
ef0a00ec0c
3 changed files with 47 additions and 62 deletions
|
@ -76,11 +76,11 @@ static object *pwd_getpwuid(self, args)
|
|||
static object *pwd_getpwnam(self, args)
|
||||
object *self, *args;
|
||||
{
|
||||
object *name;
|
||||
char *name;
|
||||
struct passwd *p;
|
||||
if (!getstrarg(args, &name))
|
||||
return NULL;
|
||||
if ((p = getpwnam(getstringvalue(name))) == NULL) {
|
||||
if ((p = getpwnam(name)) == NULL) {
|
||||
err_setstr(KeyError, "getpwnam(): name not found");
|
||||
return NULL;
|
||||
}
|
||||
|
@ -176,11 +176,11 @@ static object *grp_getgrgid(self, args)
|
|||
static object *grp_getgrnam(self, args)
|
||||
object *self, *args;
|
||||
{
|
||||
object *name;
|
||||
char *name;
|
||||
struct group *p;
|
||||
if (!getstrarg(args, &name))
|
||||
return NULL;
|
||||
if ((p = getgrnam(getstringvalue(name))) == NULL) {
|
||||
if ((p = getgrnam(name)) == NULL) {
|
||||
err_setstr(KeyError, "getgrnam(): name not found");
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue