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

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Nov 5 12:19:42 PST 2014


Author: martinl
Date: 2014-11-05 12:19:42 -0800 (Wed, 05 Nov 2014)
New Revision: 62622

Modified:
   grass/trunk/gui/wxpython/core/utils.py
Log:
wxGUI: catch ValueError in utils.split()

Modified: grass/trunk/gui/wxpython/core/utils.py
===================================================================
--- grass/trunk/gui/wxpython/core/utils.py	2014-11-05 19:16:36 UTC (rev 62621)
+++ grass/trunk/gui/wxpython/core/utils.py	2014-11-05 20:19:42 UTC (rev 62622)
@@ -44,10 +44,16 @@
 
 def split(s):
     """Platform spefic shlex.split"""
-    if sys.platform == "win32":
-        return shlex.split(s.replace('\\', r'\\'))
-    else:
-        return shlex.split(s)
+    try:
+        if sys.platform == "win32":
+            return shlex.split(s.replace('\\', r'\\'))
+        else:
+            print shlex.split(s)
+            return shlex.split(s)
+    except ValueError as e:
+        sys.stderr.write(_("Syntax error: %s") % e)
+    
+    return []
 
 def GetTempfile(pref=None):
     """Creates GRASS temporary file using defined prefix.



More information about the grass-commit mailing list