Repository navigation
Commit 5088987
fix(web_programming): catch HTTPStatusError in crypto_price_tracker fallback
The build check on this PR fails in web_programming/crypto_price_tracker.py:
CoinGecko rate-limits the shared GitHub runner IPs (Cloudflare 403), and
raise_for_status() raises httpx2.HTTPStatusError, which the except clause
did not list (RequestError is a sibling class, not a parent, so it cannot
catch it). The intended return-0.0 fallback therefore never ran and the
doctest failed.
Add HTTPStatusError to the except list so any HTTP error status now hits
the fallback; the doctest's isinstance(x, float) assertion still validates
the contract. Ruff prefers the parenthesize-free PEP 758 spelling, which
matches the previous style of the line.
This is a pre-existing defect on master, unrelated to #15234. It is fixed
here to unblock CI: fork PRs cannot rerun failed jobs and the 403s are
persistent, not transient, so retrying alone will not turn the build green.
Co-Authored-By: Claude Code <noreply@anthropic.com>1 parent c21d1ab commit 5088987
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
0 commit comments