Skip to content

Commit

Permalink
fix toUnselect could be undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
pesekon2 committed Dec 7, 2024
1 parent 272dde2 commit f12cc4f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gui/wxpython/gmodeler/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,8 @@ def _onSelectShape(self, shape, append=False):

if not append:
toUnselect = [s for s in shapeList if s.Selected()]
else:
toUnselect = []

Check failure on line 447 in gui/wxpython/gmodeler/canvas.py

View workflow job for this annotation

GitHub Actions / Python Code Quality Checks (ubuntu-22.04)

Ruff (SIM108)

gui/wxpython/gmodeler/canvas.py:444:13: SIM108 Use ternary operator `toUnselect = [s for s in shapeList if s.Selected()] if not append else []` instead of `if`-`else`-block

shape.Select(True, dc)

Expand Down

0 comments on commit f12cc4f

Please sign in to comment.