瀏覽代碼

wxGUI: RunCommand() print debug if no parent defined

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@57097 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 11 年之前
父節點
當前提交
52f671e716
共有 1 個文件被更改,包括 6 次插入4 次删除
  1. 6 4
      gui/wxpython/core/gcmd.py

+ 6 - 4
gui/wxpython/core/gcmd.py

@@ -672,11 +672,13 @@ def RunCommand(prog, flags = "", overwrite = False, quiet = False, verbose = Fal
                   (ret, (time.time() - start)))
     
     Debug.msg(3, "gcmd.RunCommand(): print error")
-    if ret != 0 and parent:
-        Debug.msg(2, "gcmd.RunCommand(): error %s" % stderr)
-        if (stderr == None):
-            Debug.msg(2, "gcmd.RunCommand(): nothing to print ???")
+    if ret != 0:
+        if stderr:
+            Debug.msg(2, "gcmd.RunCommand(): error %s" % stderr)
         else:
+            Debug.msg(2, "gcmd.RunCommand(): nothing to print ???")
+        
+        if parent:
             GError(parent = parent,
                    caption = _("Error in %s") % prog,
                    message = stderr)