summaryrefslogtreecommitdiffstats
path: root/Objects/fileobject.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1991-06-07 16:10:43 (GMT)
committerGuido van Rossum <guido@python.org>1991-06-07 16:10:43 (GMT)
commit909336104b70cae29c0c4fde4477d508e1d709ac (patch)
tree565a1a5a3aea78eeca3216ab2d95bc74b73286a1 /Objects/fileobject.c
parentdd0108081b1a4b44d712477308b9764139ebc6a2 (diff)
downloadcpython-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.c9
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 *