check python version

This commit is contained in:
hroff-1902 2019-05-06 18:27:05 +03:00
parent 194ab5aa92
commit 6467d3b58e

View File

@ -22,6 +22,14 @@ def main(sysargv: List[str]) -> None:
This function will initiate the bot and start the trading loop. This function will initiate the bot and start the trading loop.
:return: None :return: None
""" """
try:
worker = None
return_code = 1
# check min. python version
if sys.version_info < (3, 6):
raise SystemError("Freqtrade requires Python version >= 3.6")
arguments = Arguments( arguments = Arguments(
sysargv, sysargv,
'Free, open source crypto trading bot' 'Free, open source crypto trading bot'
@ -32,11 +40,10 @@ def main(sysargv: List[str]) -> None:
# Means if Backtesting or Hyperopt have been called we exit the bot # Means if Backtesting or Hyperopt have been called we exit the bot
if hasattr(args, 'func'): if hasattr(args, 'func'):
args.func(args) args.func(args)
# TODO: fetch return_code as returned by the command function here
return_code = 0
return return
worker = None
return_code = 1
try:
# Load and run worker # Load and run worker
worker = Worker(args) worker = Worker(args)
worker.run() worker.run()
@ -47,8 +54,8 @@ def main(sysargv: List[str]) -> None:
except OperationalException as e: except OperationalException as e:
logger.error(str(e)) logger.error(str(e))
return_code = 2 return_code = 2
except BaseException: except BaseException as e:
logger.exception('Fatal exception!') logger.exception('Fatal exception! ' + str(e))
finally: finally:
if worker: if worker:
worker.exit() worker.exit()