Skip to content

Commit

Permalink
Update events to allow spanish descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
panzarino committed Aug 24, 2017
1 parent b53512b commit c79504d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mlbgame/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,6 @@ def __init__(self, data):
"""
# loop through data
for x in data:
# remove spanish info (causes text encoding errors)
if '_es' in x:
continue
# create pitches list if attribute name is pitches
if x == 'pitches':
self.pitches = []
Expand All @@ -106,7 +103,10 @@ def __init__(self, data):
setattr(self, x, float(data[x]))
except ValueError:
# string if not number
setattr(self, x, str(data[x]))
try:
setattr(self, x, str(data[x]))
except UnicodeEncodeError:
setattr(self, x, data[x])

def nice_output(self):
"""Prints basic event info in a nice way."""
Expand Down

0 comments on commit c79504d

Please sign in to comment.