comparison Python/sysmodule.c @ 1073:2c0432fcc270 legacy-trunk

Modified most (but not yet all) I/O to always go through sys.stdout or sys.stderr or sys.stdin, and to work with any object as long as it has a write() (respectively readline()) methods. Some functions that took a FILE* argument now take an object* argument.
author Guido van Rossum <guido@python.org>
date Fri, 25 Sep 1992 21:59:05 +0000
parents a1ce5a949828
children 2937897a7d8b
comparison
equal deleted inserted replaced
1072:767ef7370d33 1073:2c0432fcc270
60 char *name; 60 char *name;
61 FILE *def; 61 FILE *def;
62 { 62 {
63 FILE *fp = NULL; 63 FILE *fp = NULL;
64 object *v = sysget(name); 64 object *v = sysget(name);
65 if (v != NULL) 65 if (v != NULL && is_fileobject(v))
66 fp = getfilefile(v); 66 fp = getfilefile(v);
67 if (fp == NULL) 67 if (fp == NULL)
68 fp = def; 68 fp = def;
69 return fp; 69 return fp;
70 } 70 }