Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -28,8 +28,7 @@ def get_weather(city: str, country_code: str = "US") -> str:
|
|
| 28 |
data = response.json()
|
| 29 |
|
| 30 |
if response.status_code != 200:
|
| 31 |
-
return f"Failed to fetch weather: {data
|
| 32 |
-
.get('message', 'Unknown error')}"
|
| 33 |
|
| 34 |
weather_description = data["weather"][0]["description"]
|
| 35 |
temperature = data["main"]["temp"]
|
|
|
|
| 28 |
data = response.json()
|
| 29 |
|
| 30 |
if response.status_code != 200:
|
| 31 |
+
return f"Failed to fetch weather: {data.get('message', 'Unknown error')}"
|
|
|
|
| 32 |
|
| 33 |
weather_description = data["weather"][0]["description"]
|
| 34 |
temperature = data["main"]["temp"]
|