Skip to content

Commit

Permalink
Fix keyCommandsDoc raises UnboundLocalError for a malformed `sett…
Browse files Browse the repository at this point in the history
…ingsSection` command (#11309)
  • Loading branch information
JulienCochuyt authored Jun 29, 2020
1 parent 675c4c5 commit da5ff4e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions keyCommandsDoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,11 @@ def _command(self, cmd=None, arg=None):
# Each of the remaining columns provides keystrokes for one layout.
# There's one less delimiter than there are columns, hence subtracting 1 instead of 2.
self._settingsNumLayouts = arg.strip("|").count("|") - 1
if self._settingsNumLayouts < 1:
raise KeyCommandsError(
f"{self._lineNum}, settingsSection command must specify the header row for a table"
" summarising the settings"
)
elif cmd == "setting":
self._handleSetting()

Expand Down

0 comments on commit da5ff4e

Please sign in to comment.