Skip to content

Commit

Permalink
remove deprecated dependency on distutils
Browse files Browse the repository at this point in the history
  • Loading branch information
jasinner committed May 28, 2024
1 parent 2ba5738 commit 06f6e48
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion osidb_bindings/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,33 @@
osidb-registry-bindings helpers
"""
import json
from distutils.util import strtobool
from os import getenv
from typing import Any, Union

from .exceptions import OSIDBBindingsException

_MAP = {
"y": True,
"yes": True,
"t": True,
"true": True,
"on": True,
"1": True,
"n": False,
"no": False,
"f": False,
"false": False,
"off": False,
"0": False,
}


def strtobool(value):
try:
return _MAP[str(value).lower()]
except KeyError:
raise ValueError('"{}" is not a valid bool value'.format(value))


def get_env(
key: str,
Expand Down

0 comments on commit 06f6e48

Please sign in to comment.