Skip to content

Commit

Permalink
modules: Replace bare except by Exception (#1578)
Browse files Browse the repository at this point in the history
i.in.spotvgt and r.unpack now use Exception instead of bare except. This fixes Flake8 warning E722 (do not use bare 'except').

---------

Co-authored-by: Vaclav Petras <wenzeslaus@gmail.com>
  • Loading branch information
ShubhamSwati and wenzeslaus committed Mar 17, 2023
1 parent 07a31f9 commit 5ccff03
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ per-file-ignores =
scripts/v.report/v.report.py: F841, E501
scripts/db.out.ogr/db.out.ogr.py: F841
scripts/g.extension/g.extension.py: F841, E722, E501
scripts/r.unpack/r.unpack.py: E722, E501
scripts/r.unpack/r.unpack.py: E501
scripts/v.unpack/v.unpack.py: F841, E722, E501
scripts/v.import/v.import.py: F841, E722, E501
scripts/db.univar/db.univar.py: E741, E501
Expand All @@ -211,7 +211,7 @@ per-file-ignores =
scripts/r.fillnulls/r.fillnulls.py: E722, E501
scripts/d.rast.edit/d.rast.edit.py: E722, E501
scripts/v.what.strds/v.what.strds.py: E722, E501
scripts/i.in.spotvgt/i.in.spotvgt.py: E722, E501
scripts/i.in.spotvgt/i.in.spotvgt.py: E501
# Line too long (esp. module interface definitions)
scripts/*/*.py: E501
# local variable 'column' is assigned to but never used
Expand Down
2 changes: 1 addition & 1 deletion scripts/i.in.spotvgt/i.in.spotvgt.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def main():
s = p.communicate()[0]
if s == "application/x-zip":
gscript.fatal(_("Please extract %s before import.") % infile)
except:
except Exception:
pass

# create VRT header for NDVI
Expand Down
2 changes: 1 addition & 1 deletion scripts/r.unpack/r.unpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def main():
data_names = [
tarinfo.name for tarinfo in tar.getmembers() if "/" not in tarinfo.name
]
except:
except Exception:
grass.fatal(_("Pack file unreadable"))

if flags["p"]:
Expand Down

0 comments on commit 5ccff03

Please sign in to comment.