Verified Commit a553d5d9 authored by Kevin Morris's avatar Kevin Morris
Browse files

fix: replace distutils.util.strtobool with our own

Reference from

This fixes a deprecation warning regarding distutil's strtobool.

Signed-off-by: Kevin Morris's avatarKevin Morris <>
parent cf4295a1
......@@ -4,7 +4,6 @@ import secrets
import string
from datetime import datetime
from distutils.util import strtobool as _strtobool
from http import HTTPStatus
from subprocess import PIPE, Popen
from typing import Callable, Iterable, List, Tuple, Union
......@@ -114,9 +113,9 @@ def sanitize_params(offset: str, per_page: str) -> Tuple[int, int]:
def strtobool(value: Union[str, bool]) -> bool:
if isinstance(value, str):
return _strtobool(value or "False")
return value
if not value:
return False
return str(value).lower() in ("y", "yes", "t", "true", "on", "1")
def file_hash(filepath: str, hash_function: Callable) -> str:
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment