Skip to content

Commit

Permalink
Lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
FastestMolasses committed Aug 6, 2024
1 parent 30e63e8 commit dce8965
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions loguru/_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ def env(key, type_, default=None):

val = environ[key]

if type_ == str:
if isinstance(type_, str):
return val
if type_ == bool:
if isinstance(type_, bool):
if val.lower() in ["1", "true", "yes", "y", "ok", "on"]:
return True
if val.lower() in ["0", "false", "no", "n", "nok", "off"]:
return False
raise ValueError(
"Invalid environment variable '%s' (expected a boolean): '%s'" % (key, val)
)
if type_ == int:
if isinstance(type_, int):
try:
return int(val)
except ValueError:
Expand Down

0 comments on commit dce8965

Please sign in to comment.