summaryrefslogtreecommitdiffstats
path: root/Lib/locale.py
diff options
context:
space:
mode:
authorFredrik Lundh <fredrik@pythonware.com>2000-07-10 19:32:19 (GMT)
committerFredrik Lundh <fredrik@pythonware.com>2000-07-10 19:32:19 (GMT)
commit663809ed830ac84f9c6fe94ad7c2a3cc302d0680 (patch)
treed69ab811159a9bf906a5cfa9061c326719f25c73 /Lib/locale.py
parentdde61644024185891e1c41d6f5de29f8780b1cff (diff)
downloadcpython-663809ed830ac84f9c6fe94ad7c2a3cc302d0680.zip
cpython-663809ed830ac84f9c6fe94ad7c2a3cc302d0680.tar.gz
cpython-663809ed830ac84f9c6fe94ad7c2a3cc302d0680.tar.bz2
-- removed get_default compatibility kludge
-- added a few extra comments to locale.py
Diffstat (limited to 'Lib/locale.py')
-rw-r--r--Lib/locale.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/locale.py b/Lib/locale.py
index 1014dbd..7dde040 100644
--- a/Lib/locale.py
+++ b/Lib/locale.py
@@ -290,9 +290,12 @@ def getdefaultlocale(envvars=('LANGUAGE', 'LC_ALL', 'LC_CTYPE', 'LANG')):
except (ImportError, AttributeError):
pass
else:
+ # make sure the code/encoding values are valid
if sys.platform == "win32" and code and code[:2] == "0x":
# map windows language identifier to language name
code = windows_locale.get(int(code, 0))
+ # ...add other platform-specific processing here, if
+ # necessary...
return code, encoding
# fall back on POSIX behaviour
@@ -306,8 +309,6 @@ def getdefaultlocale(envvars=('LANGUAGE', 'LC_ALL', 'LC_CTYPE', 'LANG')):
localename = 'C'
return _parse_localename(localename)
-# compatibility
-get_default = getdefaultlocale
def getlocale(category=LC_CTYPE):