diff --git a/src/hamburg/hamburg.py b/src/hamburg/hamburg.py index f617c88..aca3a6a 100644 --- a/src/hamburg/hamburg.py +++ b/src/hamburg/hamburg.py @@ -5,9 +5,8 @@ import socket from dataclasses import dataclass from importlib import metadata -from typing import TYPE_CHECKING, Any, cast +from typing import Any, Self, cast -import async_timeout from aiohttp import ClientError, ClientSession from aiohttp.hdrs import METH_GET from yarl import URL @@ -15,13 +14,10 @@ from .exceptions import UDPHamburgConnectionError, UDPHamburgError from .models import DisabledParking, Garage, ParkAndRide -if TYPE_CHECKING: - from typing_extensions import Self - @dataclass class UDPHamburg: - """Main class for handling data fetchting from Urban Data Platform of Hamburg.""" + """Main class for handling data fetching from Urban Data Platform of Hamburg.""" request_timeout: float = 10.0 session: ClientSession | None = None @@ -71,7 +67,7 @@ async def _request( self._close_session = True try: - async with async_timeout.timeout(self.request_timeout): + async with asyncio.timeout(self.request_timeout): response = await self.session.request( method, url,