From a39664a813efe06f549c4255ede2e5b532d2e4c9 Mon Sep 17 00:00:00 2001 From: Mark McIntyre Date: Fri, 12 May 2023 08:28:08 -0400 Subject: [PATCH] correcting some if-else syntax --- weather.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/weather.py b/weather.py index 24326a0..ad92091 100644 --- a/weather.py +++ b/weather.py @@ -102,7 +102,10 @@ class WeatherApi: units = user_preferences[nick]['units'] if nick in user_preferences.keys() else 'metric' if not location: - location = user_preferences[nick]['location'] if user_preferences[nick]['location'] else raise NoDefaultLocation() + if user_preferences[nick]['location']: + location = user_preferences[nick]['location'] + else: + raise NoDefaultLocation() # URL for current conditions current_url = f"{self.weather_api_url}/current.json?key={self.api_key}&q={location}&qai=no"