diff --git a/pettingzoo/utils/env.py b/pettingzoo/utils/env.py index 3889ee01e..00523856b 100644 --- a/pettingzoo/utils/env.py +++ b/pettingzoo/utils/env.py @@ -182,7 +182,7 @@ def last( ) -> tuple[ObsType | None, float, bool, bool, dict[str, Any]]: """Returns observation, cumulative reward, terminated, truncated, info for the current agent (specified by self.agent_selection).""" agent = self.agent_selection - assert agent + assert agent is not None observation = self.observe(agent) if observe else None return ( observation,