summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1991-06-07 22:35:42 (GMT)
committerGuido van Rossum <guido@python.org>1991-06-07 22:35:42 (GMT)
commitd783a46d73d92e9a79ef123dc6b422568e1aad69 (patch)
tree618f954c179d3b0dd21bbbd6527ecb5da0b5aea7 /Python
parent909336104b70cae29c0c4fde4477d508e1d709ac (diff)
downloadcpython-d783a46d73d92e9a79ef123dc6b422568e1aad69.zip
cpython-d783a46d73d92e9a79ef123dc6b422568e1aad69.tar.gz
cpython-d783a46d73d92e9a79ef123dc6b422568e1aad69.tar.bz2
printobject now returns an error code
Diffstat (limited to 'Python')
-rw-r--r--Python/pythonmain.c6
-rw-r--r--Python/traceback.c10
2 files changed, 10 insertions, 6 deletions
diff --git a/Python/pythonmain.c b/Python/pythonmain.c
index b855520..9fa1a58 100644
--- a/Python/pythonmain.c
+++ b/Python/pythonmain.c
@@ -289,10 +289,12 @@ print_error()
object *exception, *v;
err_get(&exception, &v);
fprintf(stderr, "Unhandled exception: ");
- printobject(exception, stderr, PRINT_RAW);
+ if (printobject(exception, stderr, PRINT_RAW) != 0)
+ err_clear();
if (v != NULL && v != None) {
fprintf(stderr, ": ");
- printobject(v, stderr, PRINT_RAW);
+ if (printobject(v, stderr, PRINT_RAW) != 0)
+ err_clear();
}
fprintf(stderr, "\n");
XDECREF(exception);
diff --git a/Python/traceback.c b/Python/traceback.c
index 0b6904f..e71f6fa 100644
--- a/Python/traceback.c
+++ b/Python/traceback.c
@@ -186,12 +186,14 @@ tb_printinternal(tb, fp)
FILE *fp;
{
while (tb != NULL) {
- if (intrcheck()) {
- fprintf(fp, "[interrupted]\n");
+ if (intrcheck())
break;
- }
fprintf(fp, " File \"");
- printobject(tb->tb_frame->f_code->co_filename, fp, PRINT_RAW);
+ if (printobject(tb->tb_frame->f_code->co_filename,
+ fp, PRINT_RAW) != 0) {
+ err_clear();
+ break;
+ }
fprintf(fp, "\", line %d\n", tb->tb_lineno);
tb_displayline(fp,
getstringvalue(tb->tb_frame->f_code->co_filename),