diff Python/getargs.c @ 82110:38830281d43b 3.2

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).
author Antoine Pitrou <solipsis@pitrou.net>
date Sat, 09 Feb 2013 23:11:27 +0100
parents 71e854617297
children c08bcf5302ec
line wrap: on
line diff
--- a/Python/getargs.c	Sat Feb 09 22:37:22 2013 +0200
+++ b/Python/getargs.c	Sat Feb 09 23:11:27 2013 +0100
@@ -288,7 +288,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 == '|')
@@ -378,7 +378,7 @@
         }
     }
 
-    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 @@
         }
         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++;
     }