Skip to content

Commit

Permalink
d.frame: Fix bare except clause (OSGeo#4597)
Browse files Browse the repository at this point in the history
  • Loading branch information
arohanajit authored Oct 29, 2024
1 parent ba809db commit e6fd110
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ per-file-ignores =
scripts/v.unpack/v.unpack.py: E722, E501
scripts/v.import/v.import.py: E722, E501
scripts/db.univar/db.univar.py: E501
scripts/d.frame/d.frame.py: E722
scripts/i.pansharpen/i.pansharpen.py: E501
scripts/v.what.strds/v.what.strds.py: E501
# Line too long (esp. module interface definitions)
Expand Down
4 changes: 2 additions & 2 deletions scripts/d.frame/d.frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def calculate_frame(frame, at, width, height):
"""
try:
b, t, l, r = list(map(float, at.split(",")))
except:
except ValueError:
fatal(_("Invalid frame position: %s") % at)

top = round(height - (t / 100.0 * height))
Expand Down Expand Up @@ -238,7 +238,7 @@ def create_frame(monitor, frame, at, overwrite=False):
width = int(line.split("=", 1)[1].rsplit(" ", 1)[0])
elif "HEIGHT" in line:
height = int(line.split("=", 1)[1].rsplit(" ", 1)[0])
except:
except (ValueError, IndexError):
pass

if width < 0 or height < 0:
Expand Down

0 comments on commit e6fd110

Please sign in to comment.