From de62412e8abf02e4b0abb6e803f6b70ace6d5997 Mon Sep 17 00:00:00 2001 From: Death916 Date: Sun, 23 Mar 2025 06:13:00 -0700 Subject: [PATCH] fixed try --- deathclock/scores.py | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/deathclock/scores.py b/deathclock/scores.py index 14f238c..0038b95 100644 --- a/deathclock/scores.py +++ b/deathclock/scores.py @@ -62,24 +62,22 @@ class mlbScores: return [] def get_scores(self): - try: - games = self.get_games() - scores_list = [] - for game in games: - try: - game_data = { - 'home_team': game['home_name'], - 'home_score': game['home_score'], - 'away_team': game['away_name'], - 'away_score': game['away_score'], - 'status': game['status'] - } - scores_list.append(game_data) - except KeyError as e: - print(f"Error processing game data: {e}") - continue - self._scores = scores_list - + games = self.get_games() + scores_list = [] + for game in games: + try: + game_data = { + 'home_team': game['home_name'], + 'home_score': game['home_score'], + 'away_team': game['away_name'], + 'away_score': game['away_score'], + 'status': game['status'] + } + scores_list.append(game_data) + except KeyError as e: + print(f"Error processing game data: {e}") + continue + if __name__ == "__main__":