Skip to content

Commit

Permalink
Catch ValueError instead of KeyError when accessing ControllerModels …
Browse files Browse the repository at this point in the history
…values with parentheses (line 118).
  • Loading branch information
creatorcary committed Jun 3, 2024
1 parent c6a5250 commit 487d4a4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def _get_model_and_controller(self):
# to using the parenthesis approach because that matches
# an entry in the enum by value
dmi_model = ControllerModels(model)
except KeyError:
except ValueError:
# this shouldn't ever happen because the instantiator of this class
# checks DMI before we even get here but better safe than sorry
logger.warning('Unexpected model: %r from dmi: %r', model, self.dmi)
Expand Down

0 comments on commit 487d4a4

Please sign in to comment.