From 08e80bca8086530965c1d06144a6b352657f6d4d Mon Sep 17 00:00:00 2001 From: hroff-1902 Date: Thu, 18 Apr 2019 23:38:54 +0300 Subject: [PATCH] suppress ugly tracebacks at Ctrl+C --- freqtrade/optimize/hyperopt.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/freqtrade/optimize/hyperopt.py b/freqtrade/optimize/hyperopt.py index d30533b3f..a878bae29 100644 --- a/freqtrade/optimize/hyperopt.py +++ b/freqtrade/optimize/hyperopt.py @@ -398,10 +398,11 @@ class CustomImmediateResultBackend(LokyBackend): Use it to run Optimizer.tell() with immediate results of the backtest() evaluated in the joblib worker process. """ - # Fetch results from the Future object passed to us. - # Future object is assumed to be 'done' already. - f_val = result.result().copy() - _hyperopt.parallel_callback(f_val) + if not result.exception(): + # Fetch results from the Future object passed to us. + # Future object is assumed to be 'done' already. + f_val = result.result().copy() + _hyperopt.parallel_callback(f_val) def apply_async(self, func, callback=None): cbs = MultiCallback(callback, self.callback)