don't use plain eval

This commit is contained in:
Matthias
2024-06-08 09:31:50 +02:00
parent 2f83ff73e2
commit cef9c45f68
+2 -1
View File
@@ -2,6 +2,7 @@
This module contains the configuration class This module contains the configuration class
""" """
import ast
import logging import logging
import warnings import warnings
from copy import deepcopy from copy import deepcopy
@@ -301,7 +302,7 @@ class Configuration:
# Edge section: # Edge section:
if "stoploss_range" in self.args and self.args["stoploss_range"]: if "stoploss_range" in self.args and self.args["stoploss_range"]:
txt_range = eval(self.args["stoploss_range"]) txt_range = ast.literal_eval(self.args["stoploss_range"])
config["edge"].update({"stoploss_range_min": txt_range[0]}) config["edge"].update({"stoploss_range_min": txt_range[0]})
config["edge"].update({"stoploss_range_max": txt_range[1]}) config["edge"].update({"stoploss_range_max": txt_range[1]})
config["edge"].update({"stoploss_range_step": txt_range[2]}) config["edge"].update({"stoploss_range_step": txt_range[2]})