Skip to content

Commit 5d44bcc

Browse files
Merge pull request #239 from maximvelichko/py3.12+
Python 3.12+ compatible, get rid of distutils in py
2 parents 3c3fa58 + 40fcbd8 commit 5d44bcc

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def readme():
99

1010
setup(
1111
name="amcrest",
12-
version="1.9.8",
12+
version="1.9.9",
1313
description="Python wrapper implementation for Amcrest cameras.",
1414
long_description=readme(),
1515
author="Douglas Schilling Landgraf, Marcelo Moreira de Mello",
@@ -37,5 +37,8 @@ def readme():
3737
"Programming Language :: Python :: 3.8",
3838
"Programming Language :: Python :: 3.9",
3939
"Programming Language :: Python :: 3.10",
40+
"Programming Language :: Python :: 3.11",
41+
"Programming Language :: Python :: 3.12",
42+
"Programming Language :: Python :: 3.13",
4043
],
4144
)

src/amcrest/utils.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,11 @@
1414
from typing import List
1515

1616
# pylint: disable=no-name-in-module
17-
from distutils import util
1817
from typing import List, Tuple, Union
1918

2019
DATEFMT = "%Y-%m-%d %H:%M:%S"
2120
PRECISION = 2
2221

23-
2422
def clean_url(url: str) -> str:
2523
host = re.sub(r"^http[s]?://", "", url, flags=re.IGNORECASE)
2624
host = re.sub(r"/$", "", host)
@@ -53,7 +51,7 @@ def str2bool(value: Union[str, int]) -> bool:
5351
False values: n, no, false, off, 0
5452
"""
5553
if isinstance(value, str):
56-
return bool(util.strtobool(value))
54+
return value.lower() in ("y", "yes", "on", "1", "true", "t")
5755
return bool(value)
5856

5957

0 commit comments

Comments
 (0)