Mercurial > cpython-lru_cache-weakref
diff Python/marshal.c @ 1848:b724599401ff legacy-trunk
Merge back to main trunk
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Tue, 30 Aug 1994 08:27:36 +0000 |
| parents | cd397266dc1c |
| children | f07d66c162cb |
line wrap: on
line diff
--- a/Python/marshal.c Tue Aug 30 08:19:36 1994 +0000 +++ b/Python/marshal.c Tue Aug 30 08:27:36 1994 +0000 @@ -1,5 +1,5 @@ /*********************************************************** -Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum, +Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, Amsterdam, The Netherlands. All Rights Reserved @@ -304,10 +304,8 @@ case TYPE_FLOAT: { - extern double strtod PROTO((const char *, char **)); + extern double atof PROTO((const char *)); char buf[256]; - double res; - char *end; n = r_byte(p); if (r_string(buf, (int)n, p) != n) { err_setstr(EOFError, @@ -315,18 +313,7 @@ return NULL; } buf[n] = '\0'; - errno = 0; - res = strtod(buf, &end); - if (*end != '\0') { - err_setstr(ValueError, "bad float syntax"); - return NULL; - } - if (errno != 0) { - err_setstr(ValueError, - "float constant too large"); - return NULL; - } - return newfloatobject(res); + return newfloatobject(atof(buf)); } case TYPE_STRING:
