diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-10-04 13:55:37 +0200 |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-10-04 13:55:37 +0200 |
commit | 44b3b5457a8af636504940f508b2888f6e080ca7 (patch) | |
tree | dbb135c9572e914afbf996dde8f5aa4e15bdd593 /Modules/unicodedata.c | |
parent | ace2ccf387fbe751e09fdb4bd507a3702b637d8a (diff) | |
download | cpython-git-44b3b5457a8af636504940f508b2888f6e080ca7.tar.gz |
Remove all other uses of the C tolower()/toupper() which could break with a Turkish locale.
(except in the strop module, which is deprecated anyway)
Diffstat (limited to 'Modules/unicodedata.c')
-rw-r--r-- | Modules/unicodedata.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/unicodedata.c b/Modules/unicodedata.c index e39a4d668d..1445a95210 100644 --- a/Modules/unicodedata.c +++ b/Modules/unicodedata.c @@ -830,7 +830,7 @@ _gethash(const char *s, int len, int scale) unsigned long h = 0; unsigned long ix; for (i = 0; i < len; i++) { - h = (h * scale) + (unsigned char) toupper(Py_CHARMASK(s[i])); + h = (h * scale) + (unsigned char) Py_TOUPPER(Py_CHARMASK(s[i])); ix = h & 0xff000000; if (ix) h = (h ^ ((ix>>24) & 0xff)) & 0x00ffffff; @@ -978,7 +978,7 @@ _cmpname(PyObject *self, int code, const char* name, int namelen) if (!_getucname(self, code, buffer, sizeof(buffer))) return 0; for (i = 0; i < namelen; i++) { - if (toupper(Py_CHARMASK(name[i])) != buffer[i]) + if (Py_TOUPPER(Py_CHARMASK(name[i])) != buffer[i]) return 0; } return buffer[namelen] == '\0'; |