diff --git a/gym/spaces/box.py b/gym/spaces/box.py index a0c431f85b8..548f9aaa626 100644 --- a/gym/spaces/box.py +++ b/gym/spaces/box.py @@ -34,7 +34,7 @@ def __init__(self, low=None, high=None, shape=None, dtype=None): logger.warn("gym.spaces.Box autodetected dtype as {}. Please provide explicit dtype.".format(dtype)) self.low = low.astype(dtype) self.high = high.astype(dtype) - super().__init__(shape, dtype) + super(Box, self).__init__(shape, dtype) self.np_random = np.random.RandomState() def seed(self, seed): diff --git a/gym/spaces/dict_space.py b/gym/spaces/dict_space.py index fc964f9e763..927379ec1b8 100644 --- a/gym/spaces/dict_space.py +++ b/gym/spaces/dict_space.py @@ -41,7 +41,7 @@ def __init__(self, spaces=None, **spaces_kwargs): if isinstance(spaces, list): spaces = OrderedDict(spaces) self.spaces = spaces - super().__init__(None, None) # None for shape and dtype, since it'll require special handling + super(Dict, self).__init__(None, None) # None for shape and dtype, since it'll require special handling def seed(self, seed): [space.seed(seed) for space in self.spaces.values()] diff --git a/gym/spaces/discrete.py b/gym/spaces/discrete.py index 3def0870ef3..d731c61d3ff 100644 --- a/gym/spaces/discrete.py +++ b/gym/spaces/discrete.py @@ -12,7 +12,7 @@ class Discrete(Space): """ def __init__(self, n): self.n = n - super().__init__((), np.int64) + super(Discrete, self).__init__((), np.int64) self.np_random = np.random.RandomState() def seed(self, seed): diff --git a/gym/spaces/multi_binary.py b/gym/spaces/multi_binary.py index bcc1d94d04d..e52e59eca2b 100644 --- a/gym/spaces/multi_binary.py +++ b/gym/spaces/multi_binary.py @@ -6,7 +6,7 @@ class MultiBinary(Space): def __init__(self, n): self.n = n - super().__init__((self.n,), np.int8) + super(MultiBinary, self).__init__((self.n,), np.int8) self.np_random = np.random.RandomState() def seed(self, seed): diff --git a/gym/spaces/multi_discrete.py b/gym/spaces/multi_discrete.py index f6860191f9a..4a062f80971 100644 --- a/gym/spaces/multi_discrete.py +++ b/gym/spaces/multi_discrete.py @@ -11,7 +11,7 @@ def __init__(self, nvec): assert (np.array(nvec) > 0).all(), 'nvec (counts) have to be positive' self.nvec = np.asarray(nvec, dtype=np.uint32) - super().__init__(self.nvec.shape, np.uint32) + super(MultiDiscrete, self).__init__(self.nvec.shape, np.uint32) self.np_random = np.random.RandomState() def seed(self, seed): diff --git a/gym/spaces/tuple_space.py b/gym/spaces/tuple_space.py index ec7c30e14dc..d6b30170687 100644 --- a/gym/spaces/tuple_space.py +++ b/gym/spaces/tuple_space.py @@ -11,7 +11,7 @@ class Tuple(Space): """ def __init__(self, spaces): self.spaces = spaces - super().__init__(None, None) + super(Tuple, self).__init__(None, None) def seed(self, seed): [space.seed(seed) for space in self.spaces]