From 663809ed830ac84f9c6fe94ad7c2a3cc302d0680 Mon Sep 17 00:00:00 2001 From: Fredrik Lundh Date: Mon, 10 Jul 2000 19:32:19 +0000 Subject: [PATCH] -- removed get_default compatibility kludge -- added a few extra comments to locale.py --- Lib/locale.py | 5 +++-- Lib/site.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Lib/locale.py b/Lib/locale.py index 1014dbd915b..7dde040e7b4 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): diff --git a/Lib/site.py b/Lib/site.py index 70284e17223..17f253a77a7 100644 --- a/Lib/site.py +++ b/Lib/site.py @@ -126,7 +126,7 @@ del exit # def locale_aware_defaultencoding(): import locale - code, encoding = locale.get_default() + code, encoding = locale.getdefaultlocale() if encoding is None: encoding = 'ascii' try: