diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2005-12-19 06:05:18 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2005-12-19 06:05:18 (GMT) |
commit | 30b5c5d0116f8e670a6ca74dcb6bd076a919d681 (patch) | |
tree | 20c3e7e3ec210387941f3e9ac930537f71410a09 /Python/getargs.c | |
parent | 5d0ad50f5acf84f2e8a1ca5c6951f333aef0e25a (diff) | |
download | cpython-30b5c5d0116f8e670a6ca74dcb6bd076a919d681.zip cpython-30b5c5d0116f8e670a6ca74dcb6bd076a919d681.tar.gz cpython-30b5c5d0116f8e670a6ca74dcb6bd076a919d681.tar.bz2 |
Fix SF bug #1072182, problems with signed characters.
Most of these can be backported.
Diffstat (limited to 'Python/getargs.c')
-rw-r--r-- | Python/getargs.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Python/getargs.c b/Python/getargs.c index 16f156f..23b91fd 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -166,7 +166,7 @@ vgetargs1(PyObject *args, const char *format, va_list *p_va, int compat) if (level == 0) { if (c == 'O') max++; - else if (isalpha(c)) { + else if (isalpha(Py_CHARMASK(c))) { if (c != 'e') /* skip encoded */ max++; } else if (c == '|') @@ -255,7 +255,7 @@ vgetargs1(PyObject *args, const char *format, va_list *p_va, int compat) } } - if (*format != '\0' && !isalpha((int)(*format)) && + if (*format != '\0' && !isalpha(Py_CHARMASK((*format))) && *format != '(' && *format != '|' && *format != ':' && *format != ';') { PyErr_Format(PyExc_SystemError, @@ -347,7 +347,7 @@ converttuple(PyObject *arg, const char **p_format, va_list *p_va, int *levels, } else if (c == ':' || c == ';' || c == '\0') break; - else if (level == 0 && isalpha(c)) + else if (level == 0 && isalpha(Py_CHARMASK(c))) n++; } @@ -1223,7 +1223,7 @@ vgetargskeywords(PyObject *args, PyObject *keywords, const char *format, min = -1; max = 0; while ((i = *format++) != '\0') { - if (isalpha(i) && i != 'e') { + if (isalpha(Py_CHARMASK(i)) && i != 'e') { max++; if (*p == NULL) { PyErr_SetString(PyExc_RuntimeError, |