]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/_core_ex.py
Wait() should now return correct exit code even if thread state was EXITED (replaces...
[wxWidgets.git] / wxPython / src / _core_ex.py
index 656a54a9913e4ef20db88e6f697540609b2adf48..caaf2a8058f8c5919d2d8b5f96fa6bb596b1bf15 100644 (file)
@@ -40,11 +40,17 @@ if RELEASE_VERSION != _core_.RELEASE_VERSION:
 # http://www.alanwood.net/demos/charsetdiffs.html for differences
 # between the common latin/roman encodings.
 import locale
-default = locale.getdefaultlocale()[1]
+import codecs
+try:
+    default = locale.getdefaultlocale()[1]
+    codecs.lookup(default)
+except (ValueError, LookupError):
+    default = _sys.getdefaultencoding()
 if default:
     wx.SetDefaultPyEncoding(default)
 del default
 del locale
+del codecs
 
 #----------------------------------------------------------------------------