diff options
author | Guido van Rossum <guido@python.org> | 1993-03-16 12:15:04 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1993-03-16 12:15:04 (GMT) |
commit | e537240c252ff678d49451ee6f80fa934653a724 (patch) | |
tree | b3dcbdb870e90f5843ac66f26a102ea4da444ff5 /Modules/posixmodule.c | |
parent | f48b419a075dc237eb145e1b71cec12afdb7aff4 (diff) | |
download | cpython-e537240c252ff678d49451ee6f80fa934653a724.zip cpython-e537240c252ff678d49451ee6f80fa934653a724.tar.gz cpython-e537240c252ff678d49451ee6f80fa934653a724.tar.bz2 |
* Changed many files to use mkvalue() instead of newtupleobject().
* Fixcprt.py: added [-y file] option, do only files younger than file.
* modsupport.[ch]: added vmkvalue().
* intobject.c: use mkvalue().
* stringobject.c: added "formatstring"; renamed string* to string_*;
ceval.c: call formatstring for string % value.
* longobject.c: close memory leak in divmod.
* parsetok.c: set result node to NULL when returning an error.
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r-- | Modules/posixmodule.c | 52 |
1 files changed, 17 insertions, 35 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index a600115..4e84407 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -216,26 +216,17 @@ posix_do_stat(self, args, statfunc) END_SAVE if (res != 0) return posix_error(); - v = newtupleobject(10); - if (v == NULL) - return NULL; -#define SET(i, st_member) settupleitem(v, i, newintobject((long)st.st_member)) - SET(0, st_mode); - SET(1, st_ino); - SET(2, st_dev); - SET(3, st_nlink); - SET(4, st_uid); - SET(5, st_gid); - SET(6, st_size); - SET(7, st_atime); - SET(8, st_mtime); - SET(9, st_ctime); -#undef SET - if (err_occurred()) { - DECREF(v); - return NULL; - } - return v; + v = mkvalue("(llllllllll)", + (long)st.st_mode, + (long)st.st_ino, + (long)st.st_dev, + (long)st.st_nlink, + (long)st.st_uid, + (long)st.st_gid, + (long)st.st_size, + (long)st.st_atime, + (long)st.st_mtime, + (long)st.st_ctime); } @@ -477,21 +468,12 @@ posix_uname(self, args) END_SAVE if (res < 0) return posix_error(); - v = newtupleobject(5); - if (v == NULL) - return NULL; -#define SET(i, member) settupleitem(v, i, newstringobject(u.member)) - SET(0, sysname); - SET(1, nodename); - SET(2, release); - SET(3, version); - SET(4, machine); -#undef SET - if (err_occurred()) { - DECREF(v); - return NULL; - } - return v; + return mkvalue("(sssss)", + u.sysname, + u.nodename, + u.release, + u.version, + u.machine); } #endif /* NO_UNAME */ |