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

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jul 10 02:24:23 PDT 2014


Author: zarch
Date: 2014-07-10 02:24:23 -0700 (Thu, 10 Jul 2014)
New Revision: 61229

Modified:
   grass/trunk/lib/python/pygrass/modules/interface/module.py
Log:
pygrass: Module class raise a CalledModuleError if return code is not 0, when user run a Module instance without asking to handle the process (therefore with finish_==True).

Modified: grass/trunk/lib/python/pygrass/modules/interface/module.py
===================================================================
--- grass/trunk/lib/python/pygrass/modules/interface/module.py	2014-07-10 03:24:54 UTC (rev 61228)
+++ grass/trunk/lib/python/pygrass/modules/interface/module.py	2014-07-10 09:24:23 UTC (rev 61229)
@@ -10,6 +10,7 @@
 from xml.etree.ElementTree import fromstring
 import time
 
+from grass.exceptions import CalledModuleError
 from grass.script.core import Popen, PIPE
 from grass.pygrass.errors import GrassError, ParameterError
 from grass.pygrass.functions import docstring_property
@@ -562,9 +563,9 @@
             self.outputs['stdout'].value = stdout if stdout else ''
             self.outputs['stderr'].value = stderr if stderr else ''
             self.time = time.time() - start
-            #if self.popen.poll():
-            #    raise CalledModuleError(self.popen.returncode, self.get_bash(),
-            #                            {}, stderr)
+            if self.popen.poll():
+                raise CalledModuleError(self.popen.returncode, self.get_bash(),
+                                        {}, stderr)
         return self
 
 ###############################################################################



More information about the grass-commit mailing list