Skip to content

Commit

Permalink
wxGUI: Refactored try-except block to be more robust in dialogs.py (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
arohanajit authored Sep 26, 2024
1 parent 2098577 commit 845dfd0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ per-file-ignores =
doc/gui/wxpython/example/dialogs.py: F401
gui/scripts/d.wms.py: E501
gui/wxpython/dbmgr/base.py: E722
gui/wxpython/dbmgr/dialogs.py: E722
gui/wxpython/dbmgr/sqlbuilder.py: E722
gui/wxpython/dbmgr/manager.py: E722
gui/wxpython/docs/wxgui_sphinx/conf.py: E402, W291
Expand Down
7 changes: 4 additions & 3 deletions gui/wxpython/dbmgr/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,11 @@ def GetSQLString(self, updateValues=False):
ctype = columns[name]["ctype"]
value = columns[name]["values"][idx]
id = columns[name]["ids"][idx]
widget = self.FindWindowById(id)
try:
newvalue = self.FindWindowById(id).GetValue()
except:
newvalue = self.FindWindowById(id).GetLabel()
newvalue = widget.GetValue()
except AttributeError:
newvalue = widget.GetLabel()

if newvalue:
try:
Expand Down

0 comments on commit 845dfd0

Please sign in to comment.