diff Objects/stringobject.c @ 287:07efda2951a8 legacy-trunk

printobject now returns an error code Remove superfluous err_nomem() call
author Guido van Rossum <guido@python.org>
date Fri, 07 Jun 1991 22:58:57 +0000
parents 6321d3dc57e0
children a5e6881cebf0
line wrap: on
line diff
--- a/Objects/stringobject.c	Fri Jun 07 22:50:34 1991 +0000
+++ b/Objects/stringobject.c	Fri Jun 07 22:58:57 1991 +0000
@@ -84,7 +84,7 @@
 
 /* Methods */
 
-static void
+static int
 stringprint(op, fp, flags)
 	stringobject *op;
 	FILE *fp;
@@ -92,9 +92,10 @@
 {
 	int i;
 	char c;
+	/* XXX Ought to check for interrupts when writing long strings */
 	if (flags & PRINT_RAW) {
 		fwrite(op->ob_sval, 1, (int) op->ob_size, fp);
-		return;
+		return 0;
 	}
 	fprintf(fp, "'");
 	for (i = 0; i < op->ob_size; i++) {
@@ -107,6 +108,7 @@
 			putc(c, fp);
 	}
 	fprintf(fp, "'");
+	return 0;
 }
 
 static object *
@@ -117,7 +119,7 @@
 	int newsize = 2 + 4 * op->ob_size * sizeof(char);
 	object *v = newsizedstringobject((char *)NULL, newsize);
 	if (v == NULL) {
-		return err_nomem();
+		return NULL;
 	}
 	else {
 		register int i;