diff options
author | Guido van Rossum <guido@python.org> | 1991-12-10 14:00:03 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1991-12-10 14:00:03 (GMT) |
commit | 87e7ea72a6ef9232be9db06038943044c747971b (patch) | |
tree | 0482b0b111b4779a18f680db9a1c5bd10ca0005f /Python/marshal.c | |
parent | 97ff5308fe3e490aac51316cf5575c6119227cc8 (diff) | |
download | cpython-87e7ea72a6ef9232be9db06038943044c747971b.zip cpython-87e7ea72a6ef9232be9db06038943044c747971b.tar.gz cpython-87e7ea72a6ef9232be9db06038943044c747971b.tar.bz2 |
Use new exceptions.
Diffstat (limited to 'Python/marshal.c')
-rw-r--r-- | Python/marshal.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Python/marshal.c b/Python/marshal.c index 1af49eb..d065ebe 100644 --- a/Python/marshal.c +++ b/Python/marshal.c @@ -191,7 +191,7 @@ rd_object(fp) switch (type) { case EOF: - err_setstr(RuntimeError, "EOF read where object expected"); + err_setstr(EOFError, "EOF read where object expected"); return NULL; case TYPE_NULL: @@ -227,7 +227,7 @@ rd_object(fp) char *end; n = rd_byte(fp); if (fread(buf, 1, (int)n, fp) != n) { - err_setstr(RuntimeError, + err_setstr(EOFError, "EOF read where object expected"); return NULL; } @@ -235,11 +235,11 @@ rd_object(fp) errno = 0; res = strtod(buf, &end); if (*end != '\0') { - err_setstr(RuntimeError, "bad float syntax"); + err_setstr(ValueError, "bad float syntax"); return NULL; } if (errno != 0) { - err_setstr(RuntimeError, + err_setstr(ValueError, "float constant too large"); return NULL; } @@ -253,7 +253,7 @@ rd_object(fp) if (fread(getstringvalue(v), 1, (int)n, fp) != n) { DECREF(v); v = NULL; - err_setstr(RuntimeError, + err_setstr(EOFError, "EOF read where object expected"); } } @@ -314,7 +314,7 @@ rd_object(fp) return v; default: - err_setstr(RuntimeError, "read unknown object"); + err_setstr(TypeError, "read unknown object"); return NULL; } |