mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
printobject now returns an error code
This commit is contained in:
parent
909336104b
commit
d783a46d73
4 changed files with 14 additions and 9 deletions
|
@ -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);
|
||||
|
|
|
@ -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 \"");
|
||||
if (printobject(tb->tb_frame->f_code->co_filename,
|
||||
fp, PRINT_RAW) != 0) {
|
||||
err_clear();
|
||||
break;
|
||||
}
|
||||
fprintf(fp, " File \"");
|
||||
printobject(tb->tb_frame->f_code->co_filename, fp, PRINT_RAW);
|
||||
fprintf(fp, "\", line %d\n", tb->tb_lineno);
|
||||
tb_displayline(fp,
|
||||
getstringvalue(tb->tb_frame->f_code->co_filename),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue