From 8a2d6f83111e93c91f2c13197eee8070e14a513a Mon Sep 17 00:00:00 2001 From: bion howard Date: Sun, 28 Jun 2020 20:13:05 -0400 Subject: [PATCH] add env.close method as mentioned here: https://github.com/openai/gym/issues/1056#issuecomment-471136134 close=True was removed a while ago, so this change just adds an 'env.close' method exactly the same as the way you were doing it, without removing the old way, so it's hopefully backwards compatible (let's test it!) --- gym_minigrid/minigrid.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gym_minigrid/minigrid.py b/gym_minigrid/minigrid.py index 57491dca0..19609f644 100644 --- a/gym_minigrid/minigrid.py +++ b/gym_minigrid/minigrid.py @@ -1293,3 +1293,8 @@ def render(self, mode='human', close=False, highlight=True, tile_size=TILE_PIXEL self.window.set_caption(self.mission) return img + + def close(self): + if self.window: + self.window.close() + return