Skip to content

Commit

Permalink
CU-8692kn0yv Fix issue with fake dict in identifier based config (#347)
Browse files Browse the repository at this point in the history
More specifically the get method which was not able to return default values for non-existant keys (#341)
  • Loading branch information
mart-r authored Sep 21, 2023
1 parent 467c811 commit cd597bb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion medcat/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ class FakeDict:
"""

def __getitem__(self, arg: str) -> Any:
return getattr(self, arg)
try:
return getattr(self, arg)
except AttributeError as e:
raise KeyError from e


def __setitem__(self, arg: str, val) -> None:
setattr(self, arg, val)
Expand Down

0 comments on commit cd597bb

Please sign in to comment.