summaryrefslogtreecommitdiffstats
path: root/Python/bltinmodule.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 /Python/bltinmodule.c
parentdd0108081b1a4b44d712477308b9764139ebc6a2 (diff)
downloadcpython-909336104b70cae29c0c4fde4477d508e1d709ac.zip
cpython-909336104b70cae29c0c4fde4477d508e1d709ac.tar.gz
cpython-909336104b70cae29c0c4fde4477d508e1d709ac.tar.bz2
printobject now returns an error code
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r--Python/bltinmodule.c12
1 files changed, 8 insertions, 4 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);
}