Update tcp.py

This commit is contained in:
rick 2025-08-11 13:27:36 +07:00 committed by GitHub
parent 8ba3e4bb96
commit 36e7d8b13b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -121,7 +121,7 @@ class TCP:
async def connect(self, address: Tuple[str, int]) -> None: async def connect(self, address: Tuple[str, int]) -> None:
try: try:
await asyncio.wait_for(self._connect(address), TCP.TIMEOUT) await asyncio.wait_for(self._connect(address), TCP.TIMEOUT)
except asyncio.TimeoutError: # re raise as TimeoutError. asyncio.TimeoutError is deprecated in 3.11 except asyncio.TimeoutError:
raise TimeoutError("Connection timed out") raise TimeoutError("Connection timed out")
async def close(self) -> None: async def close(self) -> None: