Commit 002a05c
Refactor timeout and body handling to use match statements (#3112)
* Refactor timeout and body handling to use match statements
Replace isinstance chains with match/case for timeout normalization
and request body conversion in _wrap_callback.
Closes #3110
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Use wildcard case for body to preserve original fallthrough behavior
The original else branch handled any type, not just bytes(). Using
case _ preserves that catch-all semantics.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Handle (connect, None) timeout tuples correctly
Match only int/float read values in the tuple case, so (5, None)
falls through to effective = None instead of raising TypeError.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent be3a291 commit 002a05c
1 file changed
+14
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
175 | 177 | | |
176 | 178 | | |
177 | 179 | | |
178 | 180 | | |
179 | 181 | | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
187 | 189 | | |
188 | 190 | | |
189 | 191 | | |
| |||
0 commit comments