Skip to content

Commit

Permalink
fix: Hyperopt-magic - allow parent classes within the same file
Browse files Browse the repository at this point in the history
  • Loading branch information
xmatthias committed Feb 9, 2025
1 parent b9c7712 commit a8ae767
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion freqtrade/optimize/hyperopt/hyperopt_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ def hyperopt_pickle_magic(self, bases: tuple[type, ...]) -> None:
"""
for modules in bases:
if modules.__name__ != "IStrategy":
cloudpickle.register_pickle_by_value(sys.modules[modules.__module__])
if mod := sys.modules.get(modules.__module__):
cloudpickle.register_pickle_by_value(mod)
self.hyperopt_pickle_magic(modules.__bases__)

def _get_params_dict(
Expand Down

0 comments on commit a8ae767

Please sign in to comment.