summaryrefslogtreecommitdiffstats
path: root/Modules/_localemodule.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-08-13 18:43:36 (GMT)
committerGuido van Rossum <guido@python.org>2007-08-13 18:43:36 (GMT)
commitfc9ba9318fc817baf47b4af6e59029be516b5f3d (patch)
tree81c2d042cf189818c049f578da89672490416217 /Modules/_localemodule.c
parentc9341281625071479dfee3ba85e552f18dfa3a36 (diff)
downloadcpython-fc9ba9318fc817baf47b4af6e59029be516b5f3d.zip
cpython-fc9ba9318fc817baf47b4af6e59029be516b5f3d.tar.gz
cpython-fc9ba9318fc817baf47b4af6e59029be516b5f3d.tar.bz2
Don't mess with string.letters any more. It is most likely going to disappear.
Even if it isn't, it shouldn't be changed based on the locale setting IMO. (Incidentally, this makes test_csv.py pass again on my box.)
Diffstat (limited to 'Modules/_localemodule.c')
-rw-r--r--Modules/_localemodule.c62
1 files changed, 0 insertions, 62 deletions
diff --git a/Modules/_localemodule.c b/Modules/_localemodule.c
index 233cf02..d963e40 100644
--- a/Modules/_localemodule.c
+++ b/Modules/_localemodule.c
@@ -93,63 +93,6 @@ copy_grouping(char* s)
return result;
}
-static void
-fixup_ulcase(void)
-{
- PyObject *mods, *string, *ulo;
- unsigned char ul[256];
- int n, c;
-
- /* find the string module */
- mods = PyImport_GetModuleDict();
- if (!mods)
- return;
- string = PyDict_GetItemString(mods, "string");
- if (string)
- string = PyModule_GetDict(string);
- if (!string)
- return;
-
- /* create uppercase map string */
- n = 0;
- for (c = 0; c < 256; c++) {
- if (isupper(c))
- ul[n++] = c;
- }
- ulo = PyString_FromStringAndSize((const char *)ul, n);
- if (!ulo)
- return;
- if (string)
- PyDict_SetItemString(string, "uppercase", ulo);
- Py_DECREF(ulo);
-
- /* create lowercase string */
- n = 0;
- for (c = 0; c < 256; c++) {
- if (islower(c))
- ul[n++] = c;
- }
- ulo = PyString_FromStringAndSize((const char *)ul, n);
- if (!ulo)
- return;
- if (string)
- PyDict_SetItemString(string, "lowercase", ulo);
- Py_DECREF(ulo);
-
- /* create letters string */
- n = 0;
- for (c = 0; c < 256; c++) {
- if (isalpha(c))
- ul[n++] = c;
- }
- ulo = PyString_FromStringAndSize((const char *)ul, n);
- if (!ulo)
- return;
- if (string)
- PyDict_SetItemString(string, "letters", ulo);
- Py_DECREF(ulo);
-}
-
static PyObject*
PyLocale_setlocale(PyObject* self, PyObject* args)
{
@@ -171,11 +114,6 @@ PyLocale_setlocale(PyObject* self, PyObject* args)
result_object = PyString_FromString(result);
if (!result_object)
return NULL;
- /* record changes to LC_CTYPE */
- if (category == LC_CTYPE || category == LC_ALL)
- fixup_ulcase();
- /* things that got wrong up to here are ignored */
- PyErr_Clear();
} else {
/* get locale */
result = setlocale(category, NULL);