File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -115,9 +115,11 @@ async def _process_row(row: EvaluationRow) -> EvaluationRow:
115115 except asyncio .CancelledError :
116116 # Distinguish intentional cancellation (Ctrl+C, test teardown) from
117117 # aiohttp-internal cancellation caused by a poisoned DNS resolver
118- # after a server disconnect.
118+ # after a server disconnect. Task.cancelling() returns the number
119+ # of pending cancel() calls; > 0 means someone explicitly cancelled
120+ # this task.
119121 current = asyncio .current_task ()
120- if current is not None and current .cancelled ():
122+ if current is not None and current .cancelling () > 0 : # pyright: ignore[reportAttributeAccessIssue]
121123 raise # Intentional cancellation — propagate immediately
122124 # Network-level failure; discard the session so retries get a
123125 # fresh connection pool.
You can’t perform that action at this time.
0 commit comments