feat: remove strtobool

This commit is contained in:
vrenaville
2024-09-05 14:37:18 +02:00
parent 8046783eff
commit 7d5a0f2d43
6 changed files with 66 additions and 3 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ import logging
import os
import threading
import uuid
from distutils.util import strtobool
from .strtobool import strtobool
from odoo import http
+21
View File
@@ -0,0 +1,21 @@
_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 as error:
raise ValueError('"{}" is not a valid bool value'.format(value)) from error