瀏覽代碼

fix UnboundLocalError

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@38599 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 15 年之前
父節點
當前提交
8abcdb1148
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      gui/wxpython/gui_modules/globalvar.py

+ 4 - 1
gui/wxpython/gui_modules/globalvar.py

@@ -41,7 +41,10 @@ def CheckForWx():
         if map(int, version.split('.')) < minVersion:
             raise ValueError('Your wxPython version is %s.%s.%s.%s' % tuple(version.split('.')))
 
-    except (ImportError, ValueError, wxversion.VersionError), e:
+    except ImportError, e:
+        print >> sys.stderr, 'ERROR: wxGUI requires wxPython. %s' % str(e)
+        sys.exit(1)
+    except (ValueError, wxversion.VersionError), e:
         print >> sys.stderr, 'ERROR: wxGUI requires wxPython >= %d.%d.%d.%d. ' % tuple(minVersion) + \
             '%s. Detailed information in README file.' % (str(e))
         sys.exit(1)