[GRASS-SVN] r61091 - grass/trunk/lib/python/pygrass/modules/interface

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jun 30 22:07:45 PDT 2014


Author: zarch
Date: 2014-06-30 22:07:45 -0700 (Mon, 30 Jun 2014)
New Revision: 61091

Modified:
   grass/trunk/lib/python/pygrass/modules/interface/typedict.py
Log:
pygrass: Fix error massage when trying to insert to a TypeDict and instance of the wrong type

Modified: grass/trunk/lib/python/pygrass/modules/interface/typedict.py
===================================================================
--- grass/trunk/lib/python/pygrass/modules/interface/typedict.py	2014-07-01 01:59:21 UTC (rev 61090)
+++ grass/trunk/lib/python/pygrass/modules/interface/typedict.py	2014-07-01 05:07:45 UTC (rev 61091)
@@ -36,9 +36,8 @@
         if isinstance(value, self._type):
             super(TypeDict, self).__setitem__(key, value)
         else:
-            cl = repr(self._type).translate(None, "'<> ").split('.')
-            str_err = 'The value: %r is not a %s object'
-            raise TypeError(str_err % (value, cl[-1].title()))
+            str_err = 'The value: %r is not a %s instance.'
+            raise TypeError(str_err % (value, self._type.__name__))
 
     @property
     def __doc__(self):



More information about the grass-commit mailing list