[GRASS-SVN] r72297 - in grass/trunk/gui/wxpython: nviz vdigit

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Mar 2 08:38:15 PST 2018


Author: martinl
Date: 2018-03-02 08:38:15 -0800 (Fri, 02 Mar 2018)
New Revision: 72297

Modified:
   grass/trunk/gui/wxpython/nviz/wxnviz.py
   grass/trunk/gui/wxpython/vdigit/wxdigit.py
   grass/trunk/gui/wxpython/vdigit/wxdisplay.py
Log:
wxGUI: catch also WindowsError when unable to load GRASS libs

Modified: grass/trunk/gui/wxpython/nviz/wxnviz.py
===================================================================
--- grass/trunk/gui/wxpython/nviz/wxnviz.py	2018-03-02 15:54:36 UTC (rev 72296)
+++ grass/trunk/gui/wxpython/nviz/wxnviz.py	2018-03-02 16:38:15 UTC (rev 72297)
@@ -43,12 +43,15 @@
 
 from ctypes import *
 
-from grass.lib.gis import *
-from grass.lib.raster3d import *
-from grass.lib.vector import *
-from grass.lib.ogsf import *
-from grass.lib.nviz import *
-from grass.lib.raster import *
+try:
+    from grass.lib.gis import *
+    from grass.lib.raster3d import *
+    from grass.lib.vector import *
+    from grass.lib.ogsf import *
+    from grass.lib.nviz import *
+    from grass.lib.raster import *
+except (ImportError, WindowsError) as e:
+    print("wxnviz.py: {}".format(e), file=sys.stderr)
 
 from core.debug import Debug
 from core.utils import _, autoCropImageFromFile

Modified: grass/trunk/gui/wxpython/vdigit/wxdigit.py
===================================================================
--- grass/trunk/gui/wxpython/vdigit/wxdigit.py	2018-03-02 15:54:36 UTC (rev 72296)
+++ grass/trunk/gui/wxpython/vdigit/wxdigit.py	2018-03-02 16:38:15 UTC (rev 72297)
@@ -26,6 +26,8 @@
 @author Martin Landa <landa.martin gmail.com>
 """
 
+from __future__ import print_function
+
 import grass.script.core as grass
 
 from grass.pydispatch.signal import Signal
@@ -41,10 +43,9 @@
     from grass.lib.vector import *
     from grass.lib.vedit import *
     from grass.lib.dbmi import *
-except ImportError:
-    pass
+except (ImportError, WindowsError) as e:
+    print("wxdigit.py: {}".format(e), file=sys.stderr)
 
-
 class VDigitError:
 
     def __init__(self, parent):

Modified: grass/trunk/gui/wxpython/vdigit/wxdisplay.py
===================================================================
--- grass/trunk/gui/wxpython/vdigit/wxdisplay.py	2018-03-02 15:54:36 UTC (rev 72296)
+++ grass/trunk/gui/wxpython/vdigit/wxdisplay.py	2018-03-02 16:38:15 UTC (rev 72297)
@@ -31,8 +31,8 @@
     from grass.lib.gis import *
     from grass.lib.vector import *
     from grass.lib.vedit import *
-except ImportError:
-    pass
+except (ImportError, WindowsError) as e:
+    print("wxdigit.py: {}".format(e), file=sys.stderr)
 
 log = None
 progress = None



More information about the grass-commit mailing list