Skip to content

Commit

Permalink
Update importlib_metadata entry_points API call
Browse files Browse the repository at this point in the history
  • Loading branch information
JesseFarebro committed Feb 16, 2022
1 parent 3d427e0 commit 33caf9d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ package_dir =
gym = src/gym
install_requires =
numpy
importlib-metadata; python_version < '3.8'
importlib-metadata>=4.10.0; python_version < '3.10'
importlib-resources

[options.extras_require]
Expand Down
4 changes: 2 additions & 2 deletions src/python/roms/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# importlib_resources doesn't suffer from this bug.
import importlib_resources as resources

if sys.version_info < (3, 8):
if sys.version_info < (3, 10):
import importlib_metadata as metadata
else:
import importlib.metadata as metadata
Expand Down Expand Up @@ -87,7 +87,7 @@ def resolve(self) -> Tuple[Dict[str, pathlib.Path], List[pathlib.Path]]:
unsupported: List[pathlib.Path] = []

# Iterate over all entrypoints in this group
for external in metadata.entry_points().get(self.group, []):
for external in metadata.entry_points(group=self.group):
# We load the external load ROM function and
# update the ROM dict with the result
external_fn: Callable[[], List[Union[pathlib.Path, str]]] = external.load()
Expand Down

0 comments on commit 33caf9d

Please sign in to comment.