Skip to content

Commit

Permalink
Fix bug in Python aggregator.
Browse files Browse the repository at this point in the history
  • Loading branch information
BurntSushi committed Aug 23, 2014
1 parent 83c52af commit 31c8dba
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions nfldb/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -1375,9 +1375,18 @@ def _add(self, b):

def _copy(self):
"""Returns a copy of `self`."""
stats = dict([(k, getattr(self, k, 0)) for k in _player_categories])
pp = PlayPlayer(self._db, self.gsis_id, self.drive_id, self.play_id,
self.player_id, self.team, stats)
pp = PlayPlayer(self._db)
pp.gsis_id = self.gsis_id
pp.drive_id = self.drive_id
pp.play_id = self.play_id
pp.player_id = self.player_id
pp.team = self.team

ga, sa = getattr, setattr
for k in _player_categories:
v = getattr(self, k, 0)
if v != 0:
sa(pp, k, v)
pp._player = self._player
pp._play = self._play
return pp
Expand Down

0 comments on commit 31c8dba

Please sign in to comment.