From b9684254f09281278568141f9d68d1bee31b27ec Mon Sep 17 00:00:00 2001 From: anti Date: Fri, 1 May 2026 01:53:10 -0400 Subject: [PATCH] =?UTF-8?q?fix(types):=20T5=20=E2=80=94=20narrow=20AsyncCl?= =?UTF-8?q?ient|None=20with=20inline=20if;=20rename=20loop=20variable=20t?= =?UTF-8?q?=E2=86=92task=20to=20avoid=20no-redef?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- decnet/clustering/campaign/worker.py | 6 +++--- decnet/clustering/worker.py | 6 +++--- decnet/correlation/reuse_worker.py | 6 +++--- decnet/intel/worker.py | 6 +++--- decnet/mutator/engine.py | 6 +++--- decnet/webhook/client.py | 2 +- decnet/webhook/worker.py | 2 +- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/decnet/clustering/campaign/worker.py b/decnet/clustering/campaign/worker.py index fe84cac0..6cc4dc15 100644 --- a/decnet/clustering/campaign/worker.py +++ b/decnet/clustering/campaign/worker.py @@ -105,11 +105,11 @@ async def run_campaign_clusterer_loop( t.cancel() if heartbeat_task is not None: heartbeat_task.cancel() - for t in (*wake_tasks, heartbeat_task): - if t is None: + for task in (*wake_tasks, heartbeat_task): + if task is None: continue with contextlib.suppress(asyncio.CancelledError, Exception): - await t + await task if bus is not None: with contextlib.suppress(Exception): await bus.close() diff --git a/decnet/clustering/worker.py b/decnet/clustering/worker.py index 811471c8..8d6543a6 100644 --- a/decnet/clustering/worker.py +++ b/decnet/clustering/worker.py @@ -115,11 +115,11 @@ async def run_clusterer_loop( t.cancel() if heartbeat_task is not None: heartbeat_task.cancel() - for t in (*wake_tasks, heartbeat_task): - if t is None: + for task in (*wake_tasks, heartbeat_task): + if task is None: continue with contextlib.suppress(asyncio.CancelledError, Exception): - await t + await task if bus is not None: with contextlib.suppress(Exception): await bus.close() diff --git a/decnet/correlation/reuse_worker.py b/decnet/correlation/reuse_worker.py index 82707448..67d18929 100644 --- a/decnet/correlation/reuse_worker.py +++ b/decnet/correlation/reuse_worker.py @@ -120,11 +120,11 @@ async def run_reuse_loop( t.cancel() if heartbeat_task is not None: heartbeat_task.cancel() - for t in (*wake_tasks, heartbeat_task): - if t is None: + for task in (*wake_tasks, heartbeat_task): + if task is None: continue with contextlib.suppress(asyncio.CancelledError, Exception): - await t + await task if bus is not None: with contextlib.suppress(Exception): await bus.close() diff --git a/decnet/intel/worker.py b/decnet/intel/worker.py index 777941af..2e3beefb 100644 --- a/decnet/intel/worker.py +++ b/decnet/intel/worker.py @@ -200,11 +200,11 @@ async def run_intel_loop( t.cancel() if heartbeat_task is not None: heartbeat_task.cancel() - for t in (*wake_tasks, heartbeat_task): - if t is None: + for task in (*wake_tasks, heartbeat_task): + if task is None: continue with contextlib.suppress(asyncio.CancelledError, Exception): - await t + await task if bus is not None: with contextlib.suppress(Exception): await bus.close() diff --git a/decnet/mutator/engine.py b/decnet/mutator/engine.py index 3f50f542..75a03ae7 100644 --- a/decnet/mutator/engine.py +++ b/decnet/mutator/engine.py @@ -405,11 +405,11 @@ async def run_watch_loop(repo: BaseRepository, poll_interval_secs: int = 10) -> t.cancel() if heartbeat_task is not None: heartbeat_task.cancel() - for t in (*wake_tasks, heartbeat_task): - if t is None: + for task in (*wake_tasks, heartbeat_task): + if task is None: continue with contextlib.suppress(asyncio.CancelledError, Exception): - await t + await task if bus is not None: with contextlib.suppress(Exception): await bus.close() diff --git a/decnet/webhook/client.py b/decnet/webhook/client.py index 0840a2eb..ffd3a5f0 100644 --- a/decnet/webhook/client.py +++ b/decnet/webhook/client.py @@ -148,7 +148,7 @@ async def deliver( url = sub["url"] owns_client = client is None - if owns_client: + if client is None: client = httpx.AsyncClient(timeout=timeout_s) last_status: Optional[int] = None diff --git a/decnet/webhook/worker.py b/decnet/webhook/worker.py index 5c4da60a..05463e43 100644 --- a/decnet/webhook/worker.py +++ b/decnet/webhook/worker.py @@ -85,7 +85,7 @@ async def webhook_worker( shutdown = asyncio.Event() owns_http = http_client is None - if owns_http: + if http_client is None: http_client = httpx.AsyncClient(timeout=10.0) try: