diff --git a/valhalla/valhalla_build_config.py b/valhalla/valhalla_build_config.py index 3254812..44eae79 100644 --- a/valhalla/valhalla_build_config.py +++ b/valhalla/valhalla_build_config.py @@ -1,10 +1,20 @@ #!/usr/bin/env python3 from argparse import ArgumentParser, ArgumentTypeError, ArgumentDefaultsHelpFormatter -from distutils.util import strtobool import json from typing import List, Union + +def strtobool(value): + lower = str(value).lower() + if lower in {'y', 'yes', 't', 'true', 'on', '1'}: + return True + elif lower in {'n', 'no', 'f', 'false', 'off', '0'}: + return False + else: + raise ValueError('"{}" is not a valid bool value'.format(value)) + + class Optional: def __init__(self, t=None): self.type = t