[GRASS-SVN] r44112 - grass/trunk/lib/python
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Oct 31 04:23:25 EDT 2010
Author: martinl
Date: 2010-10-31 01:23:25 -0700 (Sun, 31 Oct 2010)
New Revision: 44112
Modified:
grass/trunk/lib/python/core.py
Log:
pythonlib: do not raise on error by default
Modified: grass/trunk/lib/python/core.py
===================================================================
--- grass/trunk/lib/python/core.py 2010-10-30 17:12:23 UTC (rev 44111)
+++ grass/trunk/lib/python/core.py 2010-10-31 08:23:25 UTC (rev 44112)
@@ -62,7 +62,7 @@
def __str__(self):
return repr(self.value)
-raise_on_error = True # raise exception instead of calling fatal()
+raise_on_error = False # raise exception instead of calling fatal()
debug_level = 0 # DEBUG level
def call(*args, **kwargs):
@@ -349,6 +349,7 @@
@param msg error message to be displayed
"""
+ global raise_on_error
if raise_on_error:
raise ScriptException(msg)
else:
@@ -362,7 +363,7 @@
error(msg)
sys.exit(1)
-def raise_on_error(raise_exp = True):
+def set_raise_on_error(raise_exp = True):
"""!Define behaviour on error (error() called)
@param raise_exp True to raise ScriptException instead of calling error()
More information about the grass-commit
mailing list