diff options
author | Guido van Rossum <guido@python.org> | 1991-06-07 16:10:43 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1991-06-07 16:10:43 (GMT) |
commit | 909336104b70cae29c0c4fde4477d508e1d709ac (patch) | |
tree | 565a1a5a3aea78eeca3216ab2d95bc74b73286a1 /Objects/fileobject.c | |
parent | dd0108081b1a4b44d712477308b9764139ebc6a2 (diff) | |
download | cpython-909336104b70cae29c0c4fde4477d508e1d709ac.zip cpython-909336104b70cae29c0c4fde4477d508e1d709ac.tar.gz cpython-909336104b70cae29c0c4fde4477d508e1d709ac.tar.bz2 |
printobject now returns an error code
Diffstat (limited to 'Objects/fileobject.c')
-rw-r--r-- | Objects/fileobject.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Objects/fileobject.c b/Objects/fileobject.c index b168ccf..143f697 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -117,17 +117,20 @@ file_dealloc(f) free((char *)f); } -static void +static int file_print(f, fp, flags) fileobject *f; FILE *fp; int flags; { fprintf(fp, "<%s file ", f->f_fp == NULL ? "closed" : "open"); - printobject(f->f_name, fp, flags); + if (printobject(f->f_name, fp, flags) != 0) + return -1; fprintf(fp, ", mode "); - printobject(f->f_mode, fp, flags); + if (printobject(f->f_mode, fp, flags) != 0) + return -1; fprintf(fp, ">"); + return 0; } static object * |