Skip to content

Commit

Permalink
Merge pull request #435 from cwendt94/bb_no_home_team
Browse files Browse the repository at this point in the history
Basketball Box Score Home Team not Present
  • Loading branch information
cwendt94 authored Jan 24, 2023
2 parents d9f1ff0 + c4facf3 commit 53d98a6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions espn_api/basketball/box_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ class BoxScore(ABC):
''' '''
def __init__(self, data):
self.winner = data.get('winner', 'UNDECIDED')
self.home_team = data['home']['teamId']
self.away_team = 0
if 'away' in data:
self.away_team = data['away']['teamId']
self.home_team = data.get('home', {}).get('teamId', 0)
self.away_team = data.get('away', {}).get('teamId', 0)

def __repr__(self):
away_team = self.away_team or "BYE"
home_team = self.home_team or "BYE"
Expand Down

0 comments on commit 53d98a6

Please sign in to comment.