Commit 935503f
Use inspect.isawaitable in AsyncClientResiliencyInterceptor
Replace the ad-hoc `hasattr(result, '__await__')` check in
`AsyncClientResiliencyInterceptor._record_outcome` with the canonical
`inspect.isawaitable` predicate, and tighten the `on_recreate` callback
annotation to `Callable[[], Union[None, Awaitable[object]]]` so it reflects
the actual contract (sync callbacks return None, async callbacks return an
Awaitable that we await).
Addresses the github-code-quality 'Statement has no effect' warning surfaced
on PR #135 by making the awaitable check explicit and type-driven.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 223ba40 commit 935503f
1 file changed
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | | - | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
125 | 126 | | |
126 | 127 | | |
127 | 128 | | |
128 | | - | |
| 129 | + | |
129 | 130 | | |
130 | 131 | | |
131 | 132 | | |
| |||
147 | 148 | | |
148 | 149 | | |
149 | 150 | | |
150 | | - | |
| 151 | + | |
151 | 152 | | |
152 | 153 | | |
153 | 154 | | |
0 commit comments