mirror of
https://github.com/Death916/deathclock.git
synced 2026-04-10 03:04:40 -07:00
fixed try
This commit is contained in:
parent
747af41ddc
commit
de62412e8a
1 changed files with 16 additions and 18 deletions
|
|
@ -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__":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue