summaryrefslogtreecommitdiffstats
path: root/Python
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 /Python
parentdd0108081b1a4b44d712477308b9764139ebc6a2 (diff)
downloadcpython-909336104b70cae29c0c4fde4477d508e1d709ac.zip
cpython-909336104b70cae29c0c4fde4477d508e1d709ac.tar.gz
cpython-909336104b70cae29c0c4fde4477d508e1d709ac.tar.bz2
printobject now returns an error code
Diffstat (limited to 'Python')
-rw-r--r--Python/bltinmodule.c12
-rw-r--r--Python/ceval.c7
2 files changed, 12 insertions, 7 deletions
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 @@ builtin_input(self, v)
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 @@ builtin_raw_input(self, v)
{
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 @@ eval_code(co, globals, locals, arg)
if (v != None) {
flushline();
softspace(sysget("stdout"), 1);
- printobject(v, fp, 0);
+ err = printobject(v, fp, 0);
flushline();
}
DECREF(v);
@@ -447,7 +447,7 @@ eval_code(co, globals, locals, arg)
softspace(sysget("stdout"), 0);
}
else {
- printobject(v, fp, 0);
+ err = printobject(v, fp, 0);
}
DECREF(v);
break;
@@ -933,7 +933,8 @@ prtrace(v, str)
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