diff --git a/homeassistant/util/timeout.py b/homeassistant/util/timeout.py index 94baa57e4d833..72cabffeed6f3 100644 --- a/homeassistant/util/timeout.py +++ b/homeassistant/util/timeout.py @@ -39,9 +39,9 @@ async def __aenter__(self) -> Self: async def __aexit__( self, - exc_type: type[BaseException], - exc_val: BaseException, - exc_tb: TracebackType, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, ) -> bool | None: self._exit() return None @@ -52,9 +52,9 @@ def __enter__(self) -> Self: def __exit__( self, - exc_type: type[BaseException], - exc_val: BaseException, - exc_tb: TracebackType, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, ) -> bool | None: self._loop.call_soon_threadsafe(self._exit) return None @@ -107,9 +107,9 @@ async def __aenter__(self) -> Self: async def __aexit__( self, - exc_type: type[BaseException], - exc_val: BaseException, - exc_tb: TracebackType, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, ) -> bool | None: self._exit() return None @@ -120,9 +120,9 @@ def __enter__(self) -> Self: def __exit__( self, - exc_type: type[BaseException], - exc_val: BaseException, - exc_tb: TracebackType, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, ) -> bool | None: self._loop.call_soon_threadsafe(self._exit) return None @@ -171,9 +171,9 @@ async def __aenter__(self) -> Self: async def __aexit__( self, - exc_type: type[BaseException], - exc_val: BaseException, - exc_tb: TracebackType, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, ) -> bool | None: self._stop_timer() self._manager.global_tasks.remove(self) @@ -286,9 +286,9 @@ async def __aenter__(self) -> Self: async def __aexit__( self, - exc_type: type[BaseException], - exc_val: BaseException, - exc_tb: TracebackType, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, ) -> bool | None: self._zone.exit_task(self) self._stop_timer() diff --git a/pyproject.toml b/pyproject.toml index bcd0320d6f173..0ab3fd23597cb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -722,7 +722,6 @@ ignore = [ # temporarily disabled "PT019", "PYI024", # Use typing.NamedTuple instead of collections.namedtuple - "PYI036", "PYI041", "RET503", "RET502",