[SQUASH] Fix exception when HyperOpt nested class is not defined.

This commit is contained in:
Rokas Kupstys 2021-03-24 16:24:24 +02:00
parent e9f0babe8a
commit 11689100e7

View File

@ -39,7 +39,7 @@ class HyperOptAuto(IHyperOpt):
:param name: function name.
:return: a requested function.
"""
hyperopt_cls = getattr(self.strategy, 'HyperOpt')
hyperopt_cls = getattr(self.strategy, 'HyperOpt', None)
default_func = getattr(super(), name)
if hyperopt_cls:
return getattr(hyperopt_cls, name, default_func)