[GRASS-SVN] r63207 - grass/trunk/lib/python/pygrass/vector

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Nov 27 08:18:48 PST 2014


Author: zarch
Date: 2014-11-27 08:18:48 -0800 (Thu, 27 Nov 2014)
New Revision: 63207

Modified:
   grass/trunk/lib/python/pygrass/vector/table.py
Log:
pygrass: improve error message on column type

Modified: grass/trunk/lib/python/pygrass/vector/table.py
===================================================================
--- grass/trunk/lib/python/pygrass/vector/table.py	2014-11-27 16:14:30 UTC (rev 63206)
+++ grass/trunk/lib/python/pygrass/vector/table.py	2014-11-27 16:18:48 UTC (rev 63207)
@@ -407,8 +407,9 @@
             valid_type = ('DOUBLE PRECISION', 'DOUBLE', 'INT', 'INTEGER',
                           'DATE')
             if 'VARCHAR' in col_type or col_type.upper() not in valid_type:
-                str_err = "Type is not supported, supported types are: %s"
-                raise TypeError(str_err % ", ".join(valid_type))
+                str_err = ("Type: %r is not supported."
+                           "\nSupported types are: %s")
+                raise TypeError(str_err % (col_type, ", ".join(valid_type)))
             return col_type
 
         col_type = ([check(col_type), ] if isinstance(col_type, (str, unicode))



More information about the grass-commit mailing list