check python version
This commit is contained in:
parent
194ab5aa92
commit
6467d3b58e
@ -22,21 +22,28 @@ 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
|
||||||
"""
|
"""
|
||||||
arguments = Arguments(
|
|
||||||
sysargv,
|
|
||||||
'Free, open source crypto trading bot'
|
|
||||||
)
|
|
||||||
args: Namespace = arguments.get_parsed_arg()
|
|
||||||
|
|
||||||
# A subcommand has been issued.
|
|
||||||
# Means if Backtesting or Hyperopt have been called we exit the bot
|
|
||||||
if hasattr(args, 'func'):
|
|
||||||
args.func(args)
|
|
||||||
return
|
|
||||||
|
|
||||||
worker = None
|
|
||||||
return_code = 1
|
|
||||||
try:
|
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(
|
||||||
|
sysargv,
|
||||||
|
'Free, open source crypto trading bot'
|
||||||
|
)
|
||||||
|
args: Namespace = arguments.get_parsed_arg()
|
||||||
|
|
||||||
|
# A subcommand has been issued.
|
||||||
|
# Means if Backtesting or Hyperopt have been called we exit the bot
|
||||||
|
if hasattr(args, 'func'):
|
||||||
|
args.func(args)
|
||||||
|
# TODO: fetch return_code as returned by the command function here
|
||||||
|
return_code = 0
|
||||||
|
return
|
||||||
|
|
||||||
# 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()
|
||||||
|
Loading…
Reference in New Issue
Block a user