diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2013-02-09 23:16:51 +0100 |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2013-02-09 23:16:51 +0100 |
commit | 8ad5b07ccb81f51551ac087a5409ebc85c0d16a7 (patch) | |
tree | 0496567aa3d6d37dc456da69e9b32f7da561f102 /Python/getargs.c | |
parent | 151699a202e6213c1f02b37605a033975ae52307 (diff) | |
parent | c73c561181c3ea3bf15c908a827878e1450a5ac6 (diff) | |
download | cpython-git-8ad5b07ccb81f51551ac087a5409ebc85c0d16a7.tar.gz |
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), mpdecimal (needs to build without Python.h).
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 18c8e91884..ae931b92aa 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -244,7 +244,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 == '|') @@ -336,7 +336,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, @@ -429,7 +429,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++; } |