diff --git a/gui/wxpython/iscatt/core_c.py b/gui/wxpython/iscatt/core_c.py index 93f90e6a2ee..1af6fe11186 100644 --- a/gui/wxpython/iscatt/core_c.py +++ b/gui/wxpython/iscatt/core_c.py @@ -82,7 +82,8 @@ def ApplyColormap(vals, vals_mask, colmap, out_vals): def MergeArrays(merged_arr, overlay_arr, alpha): if merged_arr.shape != overlay_arr.shape: - GException("MergeArrays: merged_arr.shape != overlay_arr.shape") + msg = "MergeArrays: merged_arr.shape != overlay_arr.shape" + raise GException(msg) c_uint8_p = POINTER(c_uint8) merged_p = merged_arr.ctypes.data_as(c_uint8_p) diff --git a/gui/wxpython/iscatt/iscatt_core.py b/gui/wxpython/iscatt/iscatt_core.py index 8ad40df672a..063e2cca08b 100644 --- a/gui/wxpython/iscatt/iscatt_core.py +++ b/gui/wxpython/iscatt/iscatt_core.py @@ -139,7 +139,7 @@ def ComputeCatsScatts(self, cats_ids): ) if returncode < 0: - GException(_("Computing of scatter plots failed.")) + raise GException(_("Computing of scatter plots failed.")) def CatRastUpdater(self): return self.cat_rast_updater @@ -274,7 +274,7 @@ def _updateCatRast(self, bbox, areas_cats, updated_cats): region = self.an_data.GetRegion() ret = UpdateCatRast(patch_rast, region, self.scatts_dt.GetCatRastCond(cat)) if ret < 0: - GException(_("Patching category raster conditions file failed.")) + raise GException(_("Patching category raster conditions file failed.")) RunCommand("g.remove", flags="f", type="raster", name=patch_rast) def _rasterize(self, grass_region, layer, cat, out_rast): @@ -296,7 +296,7 @@ def _rasterize(self, grass_region, layer, cat, out_rast): ) if ret != 0: - GException(_("v.build failed:\n%s") % msg) + raise GException(_("v.build failed:\n%s") % msg) environs = os.environ.copy() environs["GRASS_REGION"] = grass_region["GRASS_REGION"] @@ -316,7 +316,7 @@ def _rasterize(self, grass_region, layer, cat, out_rast): ) if ret != 0: - GException(_("v.to.rast failed:\n{messages}").format(messages=msg)) + raise GException(_("v.to.rast failed:\n{messages}").format(messages=msg)) def _create_grass_region_env(self, bbox): r = self.an_data.GetRegion() @@ -383,7 +383,8 @@ def Create(self, bands): self.region = GetRegion() if self.region["rows"] * self.region["cols"] > MAX_NCELLS: - GException("too big region") + msg = "too big region" + raise GException(msg) self.bands_info = {} @@ -391,7 +392,7 @@ def Create(self, bands): i = GetRasterInfo(b) if i is None: - GException("raster %s is not CELL type" % (b)) + raise GException("raster %s is not CELL type" % (b)) self.bands_info[b] = i # TODO check size of raster