use __mro__ for plugin loading when we search for its base class.
This would relax the constraint a little bit, allowing subclassing existing plugins. Signed-off-by: 夏恺(Xia Kai) <xiaket@gmail.com>
This commit is contained in:
parent
b33074b703
commit
cd6d865e27
1 changed files with 1 additions and 1 deletions
|
@ -329,7 +329,7 @@ class PluginLoader:
|
|||
obj = getattr(self._module_cache[path], self.class_name)
|
||||
else:
|
||||
obj = getattr(self._module_cache[path], self.class_name)(*args, **kwargs)
|
||||
if self.base_class and self.base_class not in [base.__name__ for base in obj.__class__.__bases__]:
|
||||
if self.base_class and self.base_class not in [base.__name__ for base in obj.__class__.__mro__]:
|
||||
return None
|
||||
|
||||
return obj
|
||||
|
|
Loading…
Reference in a new issue