summaryrefslogtreecommitdiff
path: root/Lib/locale.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/locale.py')
-rw-r--r--Lib/locale.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/locale.py b/Lib/locale.py
index 372c955d0e..75a6435430 100644
--- a/Lib/locale.py
+++ b/Lib/locale.py
@@ -564,7 +564,10 @@ else:
according to the system configuration."""
if do_setlocale:
oldloc = setlocale(LC_CTYPE)
- setlocale(LC_CTYPE, "")
+ try:
+ setlocale(LC_CTYPE, "")
+ except:
+ pass
result = nl_langinfo(CODESET)
setlocale(LC_CTYPE, oldloc)
return result