Enable Ruff PYI036 (#115228)

This commit is contained in:
Sid 2024-04-08 20:47:03 +02:00 committed by GitHub
parent f114ebd79d
commit cbbadf6256
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 19 deletions

View file

@ -39,9 +39,9 @@ class _GlobalFreezeContext:
async def __aexit__( async def __aexit__(
self, self,
exc_type: type[BaseException], exc_type: type[BaseException] | None,
exc_val: BaseException, exc_val: BaseException | None,
exc_tb: TracebackType, exc_tb: TracebackType | None,
) -> bool | None: ) -> bool | None:
self._exit() self._exit()
return None return None
@ -52,9 +52,9 @@ class _GlobalFreezeContext:
def __exit__( def __exit__(
self, self,
exc_type: type[BaseException], exc_type: type[BaseException] | None,
exc_val: BaseException, exc_val: BaseException | None,
exc_tb: TracebackType, exc_tb: TracebackType | None,
) -> bool | None: ) -> bool | None:
self._loop.call_soon_threadsafe(self._exit) self._loop.call_soon_threadsafe(self._exit)
return None return None
@ -107,9 +107,9 @@ class _ZoneFreezeContext:
async def __aexit__( async def __aexit__(
self, self,
exc_type: type[BaseException], exc_type: type[BaseException] | None,
exc_val: BaseException, exc_val: BaseException | None,
exc_tb: TracebackType, exc_tb: TracebackType | None,
) -> bool | None: ) -> bool | None:
self._exit() self._exit()
return None return None
@ -120,9 +120,9 @@ class _ZoneFreezeContext:
def __exit__( def __exit__(
self, self,
exc_type: type[BaseException], exc_type: type[BaseException] | None,
exc_val: BaseException, exc_val: BaseException | None,
exc_tb: TracebackType, exc_tb: TracebackType | None,
) -> bool | None: ) -> bool | None:
self._loop.call_soon_threadsafe(self._exit) self._loop.call_soon_threadsafe(self._exit)
return None return None
@ -171,9 +171,9 @@ class _GlobalTaskContext:
async def __aexit__( async def __aexit__(
self, self,
exc_type: type[BaseException], exc_type: type[BaseException] | None,
exc_val: BaseException, exc_val: BaseException | None,
exc_tb: TracebackType, exc_tb: TracebackType | None,
) -> bool | None: ) -> bool | None:
self._stop_timer() self._stop_timer()
self._manager.global_tasks.remove(self) self._manager.global_tasks.remove(self)
@ -286,9 +286,9 @@ class _ZoneTaskContext:
async def __aexit__( async def __aexit__(
self, self,
exc_type: type[BaseException], exc_type: type[BaseException] | None,
exc_val: BaseException, exc_val: BaseException | None,
exc_tb: TracebackType, exc_tb: TracebackType | None,
) -> bool | None: ) -> bool | None:
self._zone.exit_task(self) self._zone.exit_task(self)
self._stop_timer() self._stop_timer()

View file

@ -722,7 +722,6 @@ ignore = [
# temporarily disabled # temporarily disabled
"PT019", "PT019",
"PYI024", # Use typing.NamedTuple instead of collections.namedtuple "PYI024", # Use typing.NamedTuple instead of collections.namedtuple
"PYI036",
"PYI041", "PYI041",
"RET503", "RET503",
"RET502", "RET502",