diff options
author | Guido van Rossum <guido@python.org> | 1995-01-02 19:04:15 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1995-01-02 19:04:15 (GMT) |
commit | 1ae940a5870df2f706fa884afd533847f6b0b1a8 (patch) | |
tree | ac19577f141b553bd56f998a62478719d5b81cd4 /Python/pythonrun.c | |
parent | 824de25fe2edade0ded378b4d602351272f4cf63 (diff) | |
download | cpython-1ae940a5870df2f706fa884afd533847f6b0b1a8.zip cpython-1ae940a5870df2f706fa884afd533847f6b0b1a8.tar.gz cpython-1ae940a5870df2f706fa884afd533847f6b0b1a8.tar.bz2 |
Lots of changes, most minor (fatal() instead of abort(), use of
err_fetch/err_restore and so on). But...
NOTE: import.c has been rewritten and all the DL stuff is now in the
new file importdl.c.
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r-- | Python/pythonrun.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c index de0de07..f66c8d7 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -242,12 +242,10 @@ run_command(command) void print_error() { - object *exception, *v, *f; - err_get(&exception, &v); - if (exception == NULL) { - fprintf(stderr, "print_error called but no exception\n"); - abort(); - } + object *exception, *v, *tb, *f; + err_fetch(&exception, &v, &tb); + if (exception == NULL) + fatal("print_error called but no exception"); if (exception == SystemExit) { if (v == NULL || v == None) goaway(0); @@ -262,11 +260,12 @@ print_error() } sysset("last_type", exception); sysset("last_value", v); + sysset("last_traceback", tb); f = sysget("stderr"); if (f == NULL) fprintf(stderr, "lost sys.stderr\n"); else { - printtraceback(f); + tb_print(tb, f); if (exception == SyntaxError) { object *message; char *filename, *text; @@ -331,6 +330,7 @@ print_error() } XDECREF(exception); XDECREF(v); + XDECREF(tb); } object * @@ -421,7 +421,6 @@ compile_string(str, filename, start) int start; { node *n; - int err; codeobject *co; n = parse_string(str, start); if (n == NULL) |