Fixed all environment close issues in testing (#3020)

This commit is contained in:
Mark Towers
2022-08-08 22:41:15 +01:00
committed by GitHub
parent 607602b531
commit 8b744130bc
4 changed files with 15 additions and 10 deletions

View File

@@ -375,14 +375,13 @@ class AcrobotEnv(core.Env):
np.array(pygame.surfarray.pixels3d(self.screen)), axes=(1, 0, 2)
)
def close(self):
if self.screen is not None:
import pygame
def close(self):
if self.screen is not None:
import pygame
pygame.display.quit()
pygame.quit()
self.isopen = False
pygame.display.quit()
pygame.quit()
self.isopen = False
def wrap(x, m, M):