Commit d297fcf
committed
revert: use try/finally for sse and streamable_http stream cleanup
The async with form triggers coverage.py false-positive branch arcs
on Python 3.14 — nested multi-CM async with creates WITH_EXCEPT_START
handlers whose POP_JUMP_IF_TRUE branches (did __aexit__ suppress?)
get attributed to inner async with lines via the exception table.
Memory stream __aexit__ never suppresses, so those arcs are
unreachable, but coverage.py's static analysis expects them.
try/finally has no suppression branch (it's unconditional RERAISE),
so it sidesteps the issue entirely. Keeping the explicit aclose()
chain for these two files; websocket.py stays on the merged
async with form since its single-level nesting is clean on all
tested Python versions (3.10-3.14).1 parent 906bcfc commit d297fcf
2 files changed
+12
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
547 | 547 | | |
548 | 548 | | |
549 | 549 | | |
550 | | - | |
| 550 | + | |
551 | 551 | | |
552 | 552 | | |
553 | 553 | | |
| |||
574 | 574 | | |
575 | 575 | | |
576 | 576 | | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
0 commit comments