Python 3.9 support (#2088)

* try changes in pr 1804

* fix classifiers

* typo
This commit is contained in:
Justin Terry
2020-12-17 14:55:52 -05:00
committed by GitHub
parent c4d0af393e
commit bdf95c1adc
3 changed files with 6 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ env:
- PY_VER=3.6.12 - PY_VER=3.6.12
- PY_VER=3.7.9 - PY_VER=3.7.9
- PY_VER=3.8.6 - PY_VER=3.8.6
- PY_VER=3.9.0
install: "" # so travis doesn't do pip install requirements.txt install: "" # so travis doesn't do pip install requirements.txt
script: script:

View File

@@ -1,6 +1,7 @@
"""An observation wrapper that augments observations by pixel values.""" """An observation wrapper that augments observations by pixel values."""
import collections import collections
from collections.abc import MutableMapping
import copy import copy
import numpy as np import numpy as np
@@ -8,6 +9,7 @@ import numpy as np
from gym import spaces from gym import spaces
from gym import ObservationWrapper from gym import ObservationWrapper
STATE_KEY = 'state' STATE_KEY = 'state'
@@ -60,7 +62,7 @@ class PixelObservationWrapper(ObservationWrapper):
self._observation_is_dict = False self._observation_is_dict = False
invalid_keys = set([STATE_KEY]) invalid_keys = set([STATE_KEY])
elif isinstance(wrapped_observation_space, elif isinstance(wrapped_observation_space,
(spaces.Dict, collections.MutableMapping)): (spaces.Dict, MutableMapping)):
self._observation_is_dict = True self._observation_is_dict = True
invalid_keys = set(wrapped_observation_space.spaces.keys()) invalid_keys = set(wrapped_observation_space.spaces.keys())
else: else:

View File

@@ -48,5 +48,6 @@ setup(name='gym',
'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
], ],
) )