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 /Python/getargs.c | |
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 'Python/getargs.c')
-rw-r--r-- | Python/getargs.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/getargs.c b/Python/getargs.c index a77bb05..d588102 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -288,7 +288,7 @@ vgetargs1(PyObject *args, const char *format, va_list *p_va, int flags) if (level == 0) { if (c == 'O') max++; - else if (isalpha(Py_CHARMASK(c))) { + else if (Py_ISALPHA(Py_CHARMASK(c))) { if (c != 'e') /* skip encoded */ max++; } else if (c == '|') @@ -378,7 +378,7 @@ vgetargs1(PyObject *args, const char *format, va_list *p_va, int flags) } } - if (*format != '\0' && !isalpha(Py_CHARMASK(*format)) && + if (*format != '\0' && !Py_ISALPHA(Py_CHARMASK(*format)) && *format != '(' && *format != '|' && *format != ':' && *format != ';') { PyErr_Format(PyExc_SystemError, @@ -471,7 +471,7 @@ converttuple(PyObject *arg, const char **p_format, va_list *p_va, int flags, } else if (c == ':' || c == ';' || c == '\0') break; - else if (level == 0 && isalpha(Py_CHARMASK(c))) + else if (level == 0 && Py_ISALPHA(Py_CHARMASK(c))) n++; } |