printobject now returns an error code
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 47dc920..98eb231 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -192,8 +192,10 @@
int err;
object *m, *d;
flushline();
- if (v != NULL)
- printobject(v, out, PRINT_RAW);
+ if (v != NULL) {
+ if (printobject(v, out, PRINT_RAW) != 0)
+ return NULL;
+ }
m = add_module("__main__");
d = getmoduledict(m);
return run_file(in, "<stdin>", expr_input, d, d);
@@ -450,8 +452,10 @@
{
FILE *out = sysgetfile("stdout", stdout);
flushline();
- if (v != NULL)
- printobject(v, out, PRINT_RAW);
+ if (v != NULL) {
+ if (printobject(v, out, PRINT_RAW) != 0)
+ return NULL;
+ }
return filegetline(sysget("stdin"), -1);
}
diff --git a/Python/ceval.c b/Python/ceval.c
index e24866c..975b788 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -428,7 +428,7 @@
if (v != None) {
flushline();
softspace(sysget("stdout"), 1);
- printobject(v, fp, 0);
+ err = printobject(v, fp, 0);
flushline();
}
DECREF(v);
@@ -447,7 +447,7 @@
softspace(sysget("stdout"), 0);
}
else {
- printobject(v, fp, 0);
+ err = printobject(v, fp, 0);
}
DECREF(v);
break;
@@ -933,7 +933,8 @@
char *str;
{
printf("%s ", str);
- printobject(v, stdout, 0);
+ if (printobject(v, stdout, 0) != 0)
+ err_clear(); /* Don't know what else to do */
printf("\n");
}
#endif