[GRASS-SVN] r39496 - grass/branches/releasebranch_6_4/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Oct 12 16:18:22 EDT 2009


Author: martinl
Date: 2009-10-12 16:18:22 -0400 (Mon, 12 Oct 2009)
New Revision: 39496

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/globalvar.py
Log:
fail gracefully if wxversion module is missing
    (merge r39494 from trunk)


Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/globalvar.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/globalvar.py	2009-10-12 19:52:36 UTC (rev 39495)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/globalvar.py	2009-10-12 20:18:22 UTC (rev 39496)
@@ -1,4 +1,4 @@
-"""
+"""!
 @package global.py
 
 @brief Global variables
@@ -6,7 +6,7 @@
 This module provide the space for global variables
 used in the code.
 
-(C) 2007 by the GRASS Development Team
+(C) 2007-2009 by the GRASS Development Team
 
 This program is free software under the GNU General Public
 License (>=v2). Read the file COPYING that comes with GRASS
@@ -34,7 +34,10 @@
     
     minVersion = [2, 8, 1, 1]
     try:
-        import wxversion
+        try:
+            import wxversion
+        except ImportError, e:
+            raise ImportError(e)
         wxversion.select(str(minVersion[0]) + '.' + str(minVersion[1]))
         import wx
         version = wx.version().split(' ')[0]
@@ -46,7 +49,7 @@
         sys.exit(1)
     except (ValueError, wxversion.VersionError), e:
         print >> sys.stderr, 'ERROR: wxGUI requires wxPython >= %d.%d.%d.%d. ' % tuple(minVersion) + \
-            '%s. Detailed information in README file.' % (str(e))
+            '%s.' % (str(e))
         sys.exit(1)
     except locale.Error, e:
         print >> sys.stderr, "Unable to set locale:", e



More information about the grass-commit mailing list