Selaa lähdekoodia

pygrass: Fix error massage when trying to insert to a TypeDict and instance of the wrong type

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@61091 15284696-431f-4ddb-bdfa-cd5b030d7da7
Pietro Zambelli 11 vuotta sitten
vanhempi
commit
740dd72e7e
1 muutettua tiedostoa jossa 2 lisäystä ja 3 poistoa
  1. 2 3
      lib/python/pygrass/modules/interface/typedict.py

+ 2 - 3
lib/python/pygrass/modules/interface/typedict.py

@@ -36,9 +36,8 @@ class TypeDict(OrderedDict):
         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):