Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/amcrest/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from typing import List

# pylint: disable=no-name-in-module
from distutils import util
from typing import List, Tuple, Union

DATEFMT = "%Y-%m-%d %H:%M:%S"
Expand Down Expand Up @@ -53,7 +52,13 @@ def str2bool(value: Union[str, int]) -> bool:
False values: n, no, false, off, 0
"""
if isinstance(value, str):
return bool(util.strtobool(value))
value = value.lower()
if value in ["y", "yes", "true", "t", "on", "1"]:
return True
elif value in ["n", "no", "false", "off", "0"]:
return False
else:
raise ValueError
return bool(value)


Expand Down