Spaces:
Sleeping
Sleeping
fix: Initialize info variable to prevent NameError on retry failure
Browse filesThe yfinance retry loop could cause NameError if all retries failed
because 'info' was only defined inside the try block.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
mcp-servers/valuation-basket/server.py
CHANGED
|
@@ -66,6 +66,7 @@ def _fetch_yfinance_sync(ticker: str, max_retries: int = 3) -> dict:
|
|
| 66 |
"""
|
| 67 |
import time
|
| 68 |
last_error = None
|
|
|
|
| 69 |
|
| 70 |
for attempt in range(max_retries):
|
| 71 |
try:
|
|
|
|
| 66 |
"""
|
| 67 |
import time
|
| 68 |
last_error = None
|
| 69 |
+
info = None # Initialize to avoid NameError if all retries fail
|
| 70 |
|
| 71 |
for attempt in range(max_retries):
|
| 72 |
try:
|