diff --git a/gym/spaces/dict_space.py b/gym/spaces/dict_space.py index d338bcab4a1..c552657c3a6 100644 --- a/gym/spaces/dict_space.py +++ b/gym/spaces/dict_space.py @@ -12,7 +12,7 @@ def __init__(self, spaces): if isinstance(spaces, dict): spaces = OrderedDict(sorted(list(spaces.items()))) if isinstance(spaces, list): - self.spaces = OrderedDict(spaces) + spaces = OrderedDict(spaces) self.spaces = spaces def sample(self):