Commit 671b881
committed
perf(clear_events): fix Ruff PERF203 and add Py3.13 shutdown compatibility
- Move try/except outside the loop to eliminate per-iteration exception overhead (fixes Ruff PERF203)
- Keep lock scope minimal: drain parent queue under lock, release before awaiting children
- Use asyncio.gather for concurrent child queue clearing with safe exception handling
- Handle Python 3.13 asyncio.QueueShutDown in clear_events via a version-safe except clause
(fallback to QueueEmpty on <=3.12)
No public API changes; behavior is preserved on older Python versions.1 parent 98cf92b commit 671b881
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | | - | |
| 195 | + | |
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| |||
0 commit comments