8000 drop asyncio.timeout until cpython 3.12 is the min supported · python-kasa/python-kasa@16c9711 · GitHub
[go: up one dir, main page]

Skip to content

Commit 16c9711

Browse files
committed
drop asyncio.timeout until cpython 3.12 is the min supported
1 parent fe6a6f5 commit 16c9711

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

kasa/protocol.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,17 @@
1414
import errno
1515
import logging
1616
import struct
17-
import sys
1817
from pprint import pformat as pf
1918
from typing import Dict, Generator, Optional, Union
2019

20+
# When support for cpython older than 3.12 is dropped
21+
# async_timeout can be replaced with asyncio.timeout
22+
from async_timeout import timeout as asyncio_timeout
23+
2124
from .exceptions import SmartDeviceException
2225
from .json import dumps as json_dumps
2326
from .json import loads as json_loads
2427

25-
if sys.version_info[:2] < (3, 11):
26-
from async_timeout import timeout as asyncio_timeout
27-
else:
28-
from asyncio import timeout as asyncio_timeout
29-
30-
3128
_LOGGER = logging.getLogger(__name__)
3229
_NO_RETRY_ERRORS = {errno.EHOSTDOWN, errno.EHOSTUNREACH, errno.ECONNREFUSED}
3330

0 commit comments

Comments
 (0)
0