mirror of
https://github.com/cryptoadvance/specter-desktop.git
synced 2026-08-13 12:33:29 +02:00
Replace deprecated distutils usage (removed in Python 3.12) (#2550)
Co-authored-by: k9ert <117085+k9ert@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
fdea9325f9
commit
b6c230d1cb
1 changed files with 6 additions and 2 deletions
|
|
@ -4,7 +4,6 @@ from datetime import datetime
|
|||
import json
|
||||
from flask_babel.speaklater import LazyString
|
||||
from typing import Union
|
||||
from distutils.util import strtobool
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
|
@ -15,7 +14,12 @@ def str2bool(my_str):
|
|||
return False
|
||||
elif isinstance(my_str, bool):
|
||||
return my_str
|
||||
return bool(strtobool(my_str))
|
||||
if my_str.lower() in ("y", "yes", "t", "true", "on", "1"):
|
||||
return True
|
||||
elif my_str.lower() in ("n", "no", "f", "false", "off", "0"):
|
||||
return False
|
||||
else:
|
||||
raise ValueError(f"Invalid truth value {my_str!r}")
|
||||
|
||||
|
||||
def camelcase2snake_case(name):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue