Skip to content

Commit

Permalink
remove dependency of distutils
Browse files Browse the repository at this point in the history
  • Loading branch information
jykr committed Mar 30, 2024
1 parent b529340 commit 920d937
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions bean/qc/parser.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
import argparse
import distutils


def str2bool(v):
if isinstance(v, bool):
return v
if v.lower() in ("yes", "true", "t", "y", "1"):
return True
elif v.lower() in ("no", "false", "f", "n", "0"):
return False
else:
raise argparse.ArgumentTypeError("Boolean value expected.")


def parse_args(parser=None):
Expand Down Expand Up @@ -70,7 +80,7 @@ def parse_args(parser=None):
input_parser.add_argument(
"--tiling",
dest="tiling",
type=lambda x: bool(distutils.util.strtobool(x)),
type=str2bool,
help="Specify that the guide library is tiling library without 'n guides per target' design",
)
input_parser.add_argument(
Expand Down

0 comments on commit 920d937

Please sign in to comment.