[GRASS-SVN] r57389 - grass/trunk/gui/wxpython/core

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Aug 4 02:22:59 PDT 2013


Author: martinl
Date: 2013-08-04 02:22:59 -0700 (Sun, 04 Aug 2013)
New Revision: 57389

Modified:
   grass/trunk/gui/wxpython/core/utils.py
Log:
wxGUI: fix GuiModuleMain on Windows, os.fork() is supported only on Unix

Modified: grass/trunk/gui/wxpython/core/utils.py
===================================================================
--- grass/trunk/gui/wxpython/core/utils.py	2013-08-04 09:06:49 UTC (rev 57388)
+++ grass/trunk/gui/wxpython/core/utils.py	2013-08-04 09:22:59 UTC (rev 57389)
@@ -1047,11 +1047,18 @@
 
 def GuiModuleMain(mainfn):
     """!Main function for g.gui.* modules
-
+    
+    Note: os.fork() is supported only on Unix platforms
+    
+    @todo: Replace os.fork() by multiprocessing (?)
+    
     @param module's main function
     """
-    # launch GUI in the background
-    child_pid = os.fork()
-    if child_pid == 0:
+    if sys.platform != 'win32':
+        # launch GUI in the background
+        child_pid = os.fork()
+        if child_pid == 0:
+            mainfn()
+        os._exit(0)
+    else:
         mainfn()
-    os._exit(0)



More information about the grass-commit mailing list