From 844a2f6f3fb004ddce39bb1fb080ab4996528ea4 Mon Sep 17 00:00:00 2001 From: Daniel Tomlinson Date: Sat, 23 Oct 2021 21:07:31 +0100 Subject: [PATCH] changing env var to use strings without extra quotes --- panaetius/config.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/panaetius/config.py b/panaetius/config.py index 0c64d92..34fa52a 100644 --- a/panaetius/config.py +++ b/panaetius/config.py @@ -15,7 +15,7 @@ from typing import Any # import toml import yaml -from panaetius.exceptions import KeyErrorTooDeepException, InvalidPythonException +from panaetius.exceptions import KeyErrorTooDeepException class Config: @@ -184,7 +184,8 @@ class Config: try: return ast.literal_eval(value) 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 return default