[Python-checkins] cpython: Fix wrong exception in _bootlocale (apparently this error condition is never

antoine.pitrou python-checkins at python.org
Sat Oct 12 15:00:56 CEST 2013


http://hg.python.org/cpython/rev/1a980088c269
changeset:   86223:1a980088c269
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Sat Oct 12 15:00:44 2013 +0200
summary:
  Fix wrong exception in _bootlocale (apparently this error condition is never triggered)

files:
  Lib/_bootlocale.py |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Lib/_bootlocale.py b/Lib/_bootlocale.py
--- a/Lib/_bootlocale.py
+++ b/Lib/_bootlocale.py
@@ -13,7 +13,7 @@
 else:
     try:
         _locale.CODESET
-    except ImportError:
+    except AttributeError:
         def getpreferredencoding(do_setlocale=True):
             # This path for legacy systems needs the more complex
             # getdefaultlocale() function, import the full locale module.

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list