From 27f8335a0d02c82f0deb63dfbdfe4dc31a635e60 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Fri, 7 Jul 2023 13:11:52 +0200 Subject: [PATCH] Remove dependence of wrapper on old gym --- fancy_gym/utils/wrappers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fancy_gym/utils/wrappers.py b/fancy_gym/utils/wrappers.py index 03542c7..7526269 100644 --- a/fancy_gym/utils/wrappers.py +++ b/fancy_gym/utils/wrappers.py @@ -1,5 +1,8 @@ from gymnasium.spaces import Box, Dict, flatten, flatten_space -from gym.spaces import Box as OldBox +try: + from gym.spaces import Box as OldBox +except ImportError: + OldBox = None import gymnasium as gym import numpy as np import copy