* posixmodule.c: added set{uid,gid}.

* {tuple,list,mapping,array}object.c: call printobject with 0 for flags
* compile.c (parsestr): use quote instead of '\'' at one crucial point
* arraymodule.c (array_getattr): Added __members__ attribute
This commit is contained in:
Guido van Rossum 1993-11-10 09:23:53 +00:00
parent b2e358d433
commit a3d78fb268
7 changed files with 51 additions and 9 deletions

View file

@ -865,6 +865,34 @@ posix_popen(self, args)
return newopenfileobject(fp, name, mode, pclose);
}
static object *
posix_setuid(self, args)
object *self;
object *args;
{
int uid;
if (!getargs(args, "i", &uid))
return NULL;
if (setuid(uid) < 0)
return posix_error();
INCREF(None);
return None;
}
static object *
posix_setgid(self, args)
object *self;
object *args;
{
int gid;
if (!getargs(args, "i", &gid))
return NULL;
if (setgid(gid) < 0)
return posix_error();
INCREF(None);
return None;
}
static object *
posix_waitpid(self, args)
object *self;
@ -1288,6 +1316,8 @@ static struct methodlist posix_methods[] = {
{"getuid", posix_getuid},
{"kill", posix_kill},
{"popen", posix_popen},
{"setuid", posix_setuid},
{"setgid", posix_setgid},
{"setpgrp", posix_setpgrp},
{"wait", posix_wait},
{"waitpid", posix_waitpid},