mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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).
This commit is contained in:
commit
c73c561181
11 changed files with 19 additions and 17 deletions
|
@ -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++;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue