changing env var to use strings without extra quotes

This commit is contained in:
2021-10-23 21:07:31 +01:00
parent 2092245dad
commit 844a2f6f3f

View File

@@ -15,7 +15,7 @@ from typing import Any
# import toml # import toml
import yaml import yaml
from panaetius.exceptions import KeyErrorTooDeepException, InvalidPythonException from panaetius.exceptions import KeyErrorTooDeepException
class Config: class Config:
@@ -184,7 +184,8 @@ class Config:
try: try:
return ast.literal_eval(value) return ast.literal_eval(value)
except (ValueError, SyntaxError): except (ValueError, SyntaxError):
raise InvalidPythonException(f"{value} is not valid Python.") # noqa # string without spaces: ValueError, with spaces; SyntaxError
return value
def __load_default_value(self, default: Any) -> Any: # noqa def __load_default_value(self, default: Any) -> Any: # noqa
return default return default