瀏覽代碼

wxGUI: ensure that wxversion.ensureMinimal() is not called when wx
modules is already imported


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@46096 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 14 年之前
父節點
當前提交
f0a88897bc
共有 1 個文件被更改,包括 3 次插入8 次删除
  1. 3 8
      gui/wxpython/gui_modules/globalvar.py

+ 3 - 8
gui/wxpython/gui_modules/globalvar.py

@@ -33,9 +33,6 @@ ETCIMGDIR = os.path.join(ETCDIR, "gui", "images")
 sys.path.append(os.path.join(ETCDIR, "python"))
 import grass.script as grass
 
-# wxversion.select() called once at the beginning
-check = True
-
 def CheckWxVersion(version = [2, 8, 11, 0]):
     """!Check wx version"""
     ver = wx.version().split(' ')[0]
@@ -46,9 +43,9 @@ def CheckWxVersion(version = [2, 8, 11, 0]):
 
 def CheckForWx():
     """!Try to import wx module and check its version"""
-    global check
-    if not check:
+    if 'wx' in sys.modules.keys():
         return
+    
     minVersion = [2, 8, 1, 1]
     try:
         try:
@@ -73,9 +70,7 @@ def CheckForWx():
     except locale.Error, e:
         print >> sys.stderr, "Unable to set locale:", e
         os.environ['LC_ALL'] = ''
-
-    check = False
-
+    
 if not os.getenv("GRASS_WXBUNDLED"):
     CheckForWx()
 import wx