Skip to content

Commit

Permalink
Allow python style bool on env vars.
Browse files Browse the repository at this point in the history
Signed-off-by: João Santos <[email protected]>
  • Loading branch information
joaonsantos committed Jan 27, 2023
1 parent e1a1bf0 commit 9910919
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tomlenv/_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ def _build_raw_config(self, toml: str, environ: dict[str, Any]) -> dict[str, Any
except ValueError as err:
raise ParseError(f"Invalid time, key: {env_key}") from err
elif type(orig_val) is bool:
if env_val.startswith("true") or env_val == "1":
if env_val.lower().startswith("true") or env_val == "1":
config[key] = True
elif env_val.startswith("false") or env_val == "0":
elif env_val.lower().startswith("false") or env_val == "0":
config[key] = False
else:
raise ParseError(f"Invalid bool, key: {env_key}") from err
Expand Down

0 comments on commit 9910919

Please sign in to comment.