Skip to content

Commit

Permalink
add env.close method
Browse files Browse the repository at this point in the history
as mentioned here: openai/gym#1056 (comment) 

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!)
  • Loading branch information
bionicles authored Jun 29, 2020
1 parent b84d99a commit 8a2d6f8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gym_minigrid/minigrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8a2d6f8

Please sign in to comment.