Skip to content

Commit 9e36c76

Browse files
committed
Fix minor bug, set self.cache on early exit
1 parent 8c49ea3 commit 9e36c76

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

axelrod/match.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,8 @@ def play(self):
184184
cache_key = (self.players[0], self.players[1])
185185

186186
if self._cached_enough_turns(cache_key, turns):
187-
return self._cache[cache_key][:turns]
187+
self.result = self._cache[cache_key][:turns]
188+
return self.result
188189

189190
for p in self.players:
190191
if self.reset:
@@ -202,7 +203,7 @@ def play(self):
202203
self._cache[cache_key] = result
203204

204205
self.result = result
205-
return result
206+
return self.result
206207

207208
def scores(self):
208209
"""Returns the scores of the previous Match plays."""

0 commit comments

Comments
 (0)