chore: drop async-timeout dependency on Python >= 3.11 (#132)
This commit is contained in:
@@ -25,7 +25,7 @@ packages = [
|
|||||||
|
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
python = "^3.7"
|
python = "^3.7"
|
||||||
async-timeout = ">=3.0.0"
|
async-timeout = {version = ">=3.0.0", python = "<3.11"}
|
||||||
|
|
||||||
# Documentation Dependencies
|
# Documentation Dependencies
|
||||||
sphinxcontrib-asyncio = {version = "^0.3.0", optional = true}
|
sphinxcontrib-asyncio = {version = "^0.3.0", optional = true}
|
||||||
|
|||||||
@@ -2,12 +2,16 @@ import array
|
|||||||
import asyncio
|
import asyncio
|
||||||
import logging
|
import logging
|
||||||
import socket
|
import socket
|
||||||
|
import sys
|
||||||
import traceback
|
import traceback
|
||||||
from collections import deque
|
from collections import deque
|
||||||
from copy import copy
|
from copy import copy
|
||||||
from typing import Any, Optional
|
from typing import Any, Optional
|
||||||
|
|
||||||
import async_timeout
|
if sys.version_info[:2] < (3, 11):
|
||||||
|
from async_timeout import timeout as asyncio_timeout
|
||||||
|
else:
|
||||||
|
from asyncio import timeout as asyncio_timeout
|
||||||
|
|
||||||
from .. import introspection as intr
|
from .. import introspection as intr
|
||||||
from .._private.unmarshaller import Unmarshaller
|
from .._private.unmarshaller import Unmarshaller
|
||||||
@@ -268,7 +272,7 @@ class MessageBus(BaseMessageBus):
|
|||||||
|
|
||||||
super().introspect(bus_name, path, reply_handler)
|
super().introspect(bus_name, path, reply_handler)
|
||||||
|
|
||||||
async with async_timeout.timeout(timeout):
|
async with asyncio_timeout(timeout):
|
||||||
return await future
|
return await future
|
||||||
|
|
||||||
async def request_name(
|
async def request_name(
|
||||||
|
|||||||
Reference in New Issue
Block a user