From f52a8bca1b84e64859d89068974bc4f1c3c7d9c1 Mon Sep 17 00:00:00 2001 From: Juho Inkinen Date: Fri, 30 Aug 2019 08:32:10 +0300 Subject: [PATCH] Use type to get class and thus avoid the magic method --- 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 6a5bbd7ad..44bbbb013 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__.mro()[:-1]: # omit the object class + for source_cls in type(self).mro()[:-1]: # omit the object class for default_param, default_value in \ source_cls.DEFAULT_PARAMS.items(): if default_param not in self.params: