Skip to content

Commit

Permalink
Enable Ruff PYI036 (#115228)
Browse files Browse the repository at this point in the history
  • Loading branch information
autinerd authored Apr 8, 2024
1 parent f114ebd commit cbbadf6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
36 changes: 18 additions & 18 deletions homeassistant/util/timeout.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,6 @@ ignore = [
# temporarily disabled
"PT019",
"PYI024", # Use typing.NamedTuple instead of collections.namedtuple
"PYI036",
"PYI041",
"RET503",
"RET502",
Expand Down

0 comments on commit cbbadf6

Please sign in to comment.