summaryrefslogtreecommitdiffstats
path: root/Objects/listobject.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/listobject.c
parentdd0108081b1a4b44d712477308b9764139ebc6a2 (diff)
downloadcpython-909336104b70cae29c0c4fde4477d508e1d709ac.zip
cpython-909336104b70cae29c0c4fde4477d508e1d709ac.tar.gz
cpython-909336104b70cae29c0c4fde4477d508e1d709ac.tar.bz2
printobject now returns an error code
Diffstat (limited to 'Objects/listobject.c')
-rw-r--r--Objects/listobject.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c
index ce27834..4026622 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -185,7 +185,7 @@ list_dealloc(op)
free((ANY *)op);
}
-static void
+static int
list_print(op, fp, flags)
listobject *op;
FILE *fp;
@@ -193,13 +193,14 @@ list_print(op, fp, flags)
{
int i;
fprintf(fp, "[");
- for (i = 0; i < op->ob_size && !StopPrint; i++) {
- if (i > 0) {
+ for (i = 0; i < op->ob_size; i++) {
+ if (i > 0)
fprintf(fp, ", ");
- }
- printobject(op->ob_item[i], fp, flags);
+ if (printobject(op->ob_item[i], fp, flags) != 0)
+ return -1;
}
fprintf(fp, "]");
+ return 0;
}
object *
@@ -302,7 +303,7 @@ list_concat(a, bb)
size = a->ob_size + b->ob_size;
np = (listobject *) newlistobject(size);
if (np == NULL) {
- return err_nomem();
+ return NULL;
}
for (i = 0; i < a->ob_size; i++) {
object *v = a->ob_item[i];