Hyperopt: fix 'Ran out of input' error

This commit is contained in:
Gerald Lonlas 2018-03-05 20:49:45 -08:00
parent a8fd7a69ab
commit 0bb7cc8ab5

View File

@ -524,7 +524,7 @@ class Hyperopt(Backtesting):
self.logger.info('Preparing Trials..') self.logger.info('Preparing Trials..')
signal.signal(signal.SIGINT, self.signal_handler) signal.signal(signal.SIGINT, self.signal_handler)
# read trials file if we have one # read trials file if we have one
if os.path.exists(self.trials_file): if os.path.exists(self.trials_file) and os.path.getsize(self.trials_file) > 0:
self.trials = self.read_trials() self.trials = self.read_trials()
self.current_tries = len(self.trials.results) self.current_tries = len(self.trials.results)