Skip to content

Commit

Permalink
Fix minor bug in TerminateIllegal wrapper indexing empty info dict (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
elliottower authored Nov 7, 2023
1 parent defe0d1 commit eaf6693
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pettingzoo/utils/wrappers/terminate_illegal.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ def observe(self, agent: AgentID) -> ObsType | None:
obs = super().observe(agent)
if agent == self.agent_selection:
self._prev_obs = obs
self._prev_info = self.infos[self.agent_selection]
if self.agent_selection in self.infos:
self._prev_info = self.infos[self.agent_selection]
else:
self._prev_info = {}
return obs

def step(self, action: ActionType) -> None:
Expand Down

0 comments on commit eaf6693

Please sign in to comment.