summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2003-09-04 18:24:47 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2003-09-04 18:24:47 (GMT)
commitf5b93736a2eb5fb44e36379b0c998bdaae69f6ef (patch)
tree7c2ddf5f6d06fc862c0e748fe26a2ae21f6a18ce /Modules
parent6bc06eca70f4c41f01bca5f39d54ff5f71a39092 (diff)
downloadcpython-f5b93736a2eb5fb44e36379b0c998bdaae69f6ef.zip
cpython-f5b93736a2eb5fb44e36379b0c998bdaae69f6ef.tar.gz
cpython-f5b93736a2eb5fb44e36379b0c998bdaae69f6ef.tar.bz2
Patch #798145: Return correct information from nl_langinfo(RADIXCHAR).
Will backport to 2.3.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_localemodule.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/Modules/_localemodule.c b/Modules/_localemodule.c
index 980302d..5862c1e 100644
--- a/Modules/_localemodule.c
+++ b/Modules/_localemodule.c
@@ -579,6 +579,18 @@ PyLocale_nl_langinfo(PyObject* self, PyObject* args)
/* Check whether this is a supported constant. GNU libc sometimes
returns numeric values in the char* return value, which would
crash PyString_FromString. */
+#ifdef RADIXCHAR
+ if (saved_numeric) {
+ if(item == RADIXCHAR) {
+ Py_INCREF(decimal_point);
+ return decimal_point;
+ }
+ if(item == THOUSEP) {
+ Py_INCREF(thousands_sep);
+ return thousands_sep;
+ }
+ }
+#endif
for (i = 0; langinfo_constants[i].name; i++)
if (langinfo_constants[i].value == item)
return PyString_FromString(nl_langinfo(item));