Skip to content

Commit 1ff65e6

Browse files
authored
Merge pull request #29 from nspcc-dev/ezayats/remove-distutils
Remove distutils dependency
2 parents 693ab3d + 6291e97 commit 1ff65e6

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

push-to-neofs.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import argparse
55
import magic
66
import mimetypes
7-
import distutils.util
87
from helpers.neofs import neofs_cli_execute
98

109
FILE_PATH = "FilePath" # the key for the attribute, is the path for the static page and allure report zip files
@@ -15,9 +14,12 @@
1514

1615
def str_to_bool(value):
1716
"""Convert a string representation of a boolean value to a boolean."""
18-
try:
19-
return bool(distutils.util.strtobool(value))
20-
except ValueError:
17+
value_lower = value.strip().lower()
18+
if value_lower in {'true', 't', 'yes', 'y', '1'}:
19+
return True
20+
elif value_lower in {'false', 'f', 'no', 'n', '0'}:
21+
return False
22+
else:
2123
raise argparse.ArgumentTypeError(f"Invalid boolean value: {value}")
2224

2325

0 commit comments

Comments
 (0)