From 150aa672ec88293835c3e9c8a54b80c3e0bfa140 Mon Sep 17 00:00:00 2001 From: Justin Date: Thu, 27 Apr 2023 18:51:52 +0800 Subject: [PATCH] try except for date 2 --- database_caller.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/database_caller.py b/database_caller.py index ef9bee2..39178e2 100755 --- a/database_caller.py +++ b/database_caller.py @@ -1026,7 +1026,10 @@ def updateLeagueEvents(api_key, time, logf): for d in all_data[league][ten_or_fifteen]: event = {} event['date'] = d['dateEvent'] - event['date2'] = d['dateEvent2'] + try: + event['date2'] = d['dateEvent2'] + except: + pass if time == 'live': event['progess'] = d['strProgress'] @@ -1034,7 +1037,10 @@ def updateLeagueEvents(api_key, time, logf): else: if (league == 'PGA') or (league == 'LPGA') or (league == 'PGA_EU') or (league == 'LIV') or (league == 'F1') or (league == 'NASCAR'): event['date'] = d['dateEvent'] - event['date2'] = d['dateEvent2'] + try: + event['date2'] = d['dateEvent2'] + except: + pass event['event'] = d['strEvent'].replace("\u2019","'") event['venue'] = d['strVenue'].replace("\u2019","'") event['city'] = d['strCity'].replace("\u2019","'")