Use contextlib.suppress where possible (#48189)
This commit is contained in:
parent
9656f260a4
commit
6932cf9534
86 changed files with 238 additions and 398 deletions
|
@ -2,6 +2,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
from contextlib import suppress
|
||||
from datetime import timedelta
|
||||
from functools import partial
|
||||
import logging
|
||||
|
@ -242,10 +243,8 @@ class PingDataSubProcess(PingData):
|
|||
self._count + PING_TIMEOUT,
|
||||
)
|
||||
if pinger:
|
||||
try:
|
||||
with suppress(TypeError):
|
||||
await pinger.kill()
|
||||
except TypeError:
|
||||
pass
|
||||
del pinger
|
||||
|
||||
return False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue