From 4ef0b5a74cec6bc130637f184069ccb586a7f518 Mon Sep 17 00:00:00 2001 From: Juho Inkinen Date: Thu, 29 Aug 2019 16:22:28 +0300 Subject: [PATCH] Get all parent/ancestor classes instead of only direct ones --- annif/backend/backend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/annif/backend/backend.py b/annif/backend/backend.py index 89ff3df15..6a5bbd7ad 100644 --- a/annif/backend/backend.py +++ b/annif/backend/backend.py @@ -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: