From 70c1e63107485b28160573b0f1c1311a62eb60a4 Mon Sep 17 00:00:00 2001 From: sp Date: Sun, 30 Jun 2024 18:16:56 +0200 Subject: [PATCH] refactored has_key for python3 --- examples/shields/rl/sb3utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/shields/rl/sb3utils.py b/examples/shields/rl/sb3utils.py index b177763..14ae322 100644 --- a/examples/shields/rl/sb3utils.py +++ b/examples/shields/rl/sb3utils.py @@ -36,7 +36,7 @@ class MiniGridSbShieldingWrapper(gym.core.Wrapper): def step(self, action): obs, rew, done, truncated, info = self.env.step(action) - info["no_shield_action"] = not self.shield.has_key(self.env.get_symbolic_state()) + info["no_shield_action"] = not self.shield.__contains__(self.env.get_symbolic_state()) return obs, rew, done, truncated, info def parse_sb3_arguments():