Mercurial > cpython-lru_cache-weakref
diff Python/getargs.c @ 82111:c08bcf5302ec 3.3
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).
| author | Antoine Pitrou <solipsis@pitrou.net> |
|---|---|
| date | Sat, 09 Feb 2013 23:14:42 +0100 |
| parents | 29abedd4f4bb 38830281d43b |
| children | 4e985a96a612 |
line wrap: on
line diff
--- a/Python/getargs.c Sat Feb 09 22:38:12 2013 +0200 +++ b/Python/getargs.c Sat Feb 09 23:14:42 2013 +0100 @@ -244,7 +244,7 @@ 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 @@ } } - 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 @@ } 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++; }
