summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Lib/_bootlocale.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/_bootlocale.py b/Lib/_bootlocale.py
index efe402375a..4bccac1139 100644
--- a/Lib/_bootlocale.py
+++ b/Lib/_bootlocale.py
@@ -13,7 +13,7 @@ if sys.platform.startswith("win"):
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.