Quellcode durchsuchen

wxGUI: track error when getting interface description

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@44708 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa vor 14 Jahren
Ursprung
Commit
d79e5773bb
1 geänderte Dateien mit 8 neuen und 6 gelöschten Zeilen
  1. 8 6
      gui/wxpython/gui_modules/menuform.py

+ 8 - 6
gui/wxpython/gui_modules/menuform.py

@@ -2120,13 +2120,15 @@ def getInterfaceDescription(cmd):
 
     @param cmd command (name of GRASS module)
     """
-    nuldev = file(os.devnull, 'w+')
     try:
-        cmdout = grass.Popen([cmd, '--interface-description'], stdout = grass.PIPE,
-                             stderr = nuldev).communicate()[0]
-    except OSError:
-        raise gcmd.GException, _("Unable to fetch interface description for command '%s'.") % cmd
-    nuldev.close()
+        cmdout, cmderr = grass.Popen([cmd, '--interface-description'], stdout = grass.PIPE,
+                                     stderr = grass.PIPE).communicate()
+    except OSError, e:
+        raise gcmd.GException, _("Unable to fetch interface description for command '%s'. "
+                                 "Details: %s") % (cmd, repr(e))
+    if cmderr:
+        raise gcmd.GException, _("Unable to fetch interface description for command '%s'. "
+                                 "Details: %s") % (cmd, cmderr)
     
     return cmdout.replace('grass-interface.dtd', os.path.join(globalvar.ETCDIR, 'grass-interface.dtd'))