Skip to content

Commit 149a660

Browse files
authored
fix(warning): future distutils deprecation (#921)
1 parent cd15ee9 commit 149a660

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Diff for: aws_lambda_powertools/shared/functions.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1-
from distutils.util import strtobool
21
from typing import Any, Optional, Union
32

43

4+
def strtobool(value):
5+
value = value.lower()
6+
if value in ("y", "yes", "t", "true", "on", "1"):
7+
return 1
8+
elif value in ("n", "no", "f", "false", "off", "0"):
9+
return 0
10+
else:
11+
raise ValueError("invalid truth value %r" % (value,))
12+
13+
514
def resolve_truthy_env_var_choice(env: str, choice: Optional[bool] = None) -> bool:
615
"""Pick explicit choice over truthy env value, if available, otherwise return truthy env value
716

0 commit comments

Comments
 (0)