[GRASS-SVN] r53503 - grass/branches/releasebranch_6_4/gui/wxpython/core

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Oct 19 07:46:23 PDT 2012


Author: martinl
Date: 2012-10-19 07:46:22 -0700 (Fri, 19 Oct 2012)
New Revision: 53503

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/core/globalvar.py
Log:
wxGUI: SetLanguage() better check for invalid lang settings


Modified: grass/branches/releasebranch_6_4/gui/wxpython/core/globalvar.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/core/globalvar.py	2012-10-19 14:45:05 UTC (rev 53502)
+++ grass/branches/releasebranch_6_4/gui/wxpython/core/globalvar.py	2012-10-19 14:46:22 UTC (rev 53503)
@@ -201,9 +201,13 @@
                 locale.setlocale(locale.LC_ALL, language)
             except:
                 # If we got so far, provided locale is not supported on this system
-                print "Failed to set LC_ALL to %s" % language
-                default_locale = locale.getdefaultlocale()
-                if default_locale[0]:
+                sys.stderr.write("Failed to set LC_ALL to %s\n" % language)
+                try:
+                    default_locale = locale.getdefaultlocale()
+                except:
+                    default_locale = None
+                
+                if default_locale and default_locale[0]:
                     language = default_locale[0]
                 else:
                     language = 'C'



More information about the grass-commit mailing list