diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2013-02-09 22:11:27 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2013-02-09 22:11:27 (GMT) |
commit | 4de7457009d3dac9c93cc5b471d20a8d5e92ff33 (patch) | |
tree | 7dd778385f577557e4fdafb09e55e1b9485f9407 /Objects | |
parent | b6ed17344b456f397df800cc553fef94f5b1e58b (diff) | |
download | cpython-4de7457009d3dac9c93cc5b471d20a8d5e92ff33.zip cpython-4de7457009d3dac9c93cc5b471d20a8d5e92ff33.tar.gz cpython-4de7457009d3dac9c93cc5b471d20a8d5e92ff33.tar.bz2 |
Issue #17173: Remove uses of locale-dependent C functions (isalpha() etc.) in the interpreter.
I've left a couple of them in: zlib (third-party lib), getaddrinfo.c
(doesn't include Python.h, and probably obsolete), _sre.c (legitimate
use for the re.LOCALE flag).
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/longobject.c | 4 | ||||
-rw-r--r-- | Objects/stringlib/formatter.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c index 9ca7b65..e2a4ef9 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -1887,7 +1887,7 @@ PyLong_FromString(char *str, char **pend, int base) "int() arg 2 must be >= 2 and <= 36"); return NULL; } - while (*str != '\0' && isspace(Py_CHARMASK(*str))) + while (*str != '\0' && Py_ISSPACE(Py_CHARMASK(*str))) str++; if (*str == '+') ++str; @@ -2131,7 +2131,7 @@ digit beyond the first. goto onError; if (sign < 0) Py_SIZE(z) = -(Py_SIZE(z)); - while (*str && isspace(Py_CHARMASK(*str))) + while (*str && Py_ISSPACE(Py_CHARMASK(*str))) str++; if (*str != '\0') goto onError; diff --git a/Objects/stringlib/formatter.h b/Objects/stringlib/formatter.h index 139b56c..be0d897 100644 --- a/Objects/stringlib/formatter.h +++ b/Objects/stringlib/formatter.h @@ -414,7 +414,7 @@ parse_number(STRINGLIB_CHAR *ptr, Py_ssize_t len, STRINGLIB_CHAR *end = ptr + len; STRINGLIB_CHAR *remainder; - while (ptr<end && isdigit(*ptr)) + while (ptr<end && Py_ISDIGIT(*ptr)) ++ptr; remainder = ptr; |