Skip to content

Commit

Permalink
Get all parent/ancestor classes instead of only direct ones
Browse files Browse the repository at this point in the history
  • Loading branch information
juhoinkinen committed Aug 29, 2019
1 parent 7146977 commit 4ef0b5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion annif/backend/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(self, backend_id, params, datadir):
def fill_params_with_defaults(self):
"""Set the parameters that are not provided in the projects config file
with default values defined in the backend class and its bases."""
for source_cls in (self.__class__, *self.__class__.__bases__):
for source_cls in self.__class__.mro()[:-1]: # omit the object class
for default_param, default_value in \
source_cls.DEFAULT_PARAMS.items():
if default_param not in self.params:
Expand Down

0 comments on commit 4ef0b5a

Please sign in to comment.