Skip to content

Commit 54f9908

Browse files
realiessupakeen
authored andcommitted
fix: set env vars as strings when literal_eval fails
Signed-off-by: realies <[email protected]>
1 parent 2f73d56 commit 54f9908

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: src/pinnwand/configuration.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,12 @@ def load_environment(self, dotenv_file_path: Optional[str] = None):
125125
key = key[len(prefix) :]
126126
key = key.lower()
127127
try:
128-
value = ast.literal_eval(value)
129-
setattr(self, f"_{key}", value)
128+
parsed_value = ast.literal_eval(value)
129+
setattr(self, f"_{key}", parsed_value)
130130
except (ValueError, SyntaxError):
131131
# When `ast.literal_eval` can't parse the value into another
132132
# type we take it at string value
133-
pass
133+
setattr(self, f"_{key}", value)
134134

135135

136136
class ConfigurationProvider:

0 commit comments

Comments
 (0)