Skip to content

Commit

Permalink
Update experience_source.py #749 Bug Fix (#751)
Browse files Browse the repository at this point in the history
* Update experience_source.py
* Update changelog

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Aki Nitta <nitta@akihironitta.com>
  • Loading branch information
3 people committed Oct 15, 2021
1 parent d4d1757 commit f4f6d53
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed


- Fix doctest fails with ImportError: cannot import name 'Env' from 'gym' ([#751](https://github.com/PyTorchLightning/lightning-bolts/pull/751))

## [0.4.0] - 2021-09-09

Expand Down
10 changes: 7 additions & 3 deletions pl_bolts/datamodules/experience_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@
from pl_bolts.utils import _GYM_AVAILABLE
from pl_bolts.utils.warnings import warn_missing_pkg

if _GYM_AVAILABLE:
from gym import Env
else: # pragma: no cover
try:
if _GYM_AVAILABLE:
from gym import Env
else: # pragma: no cover
warn_missing_pkg("gym")
Env = object
except:
warn_missing_pkg("gym")
Env = object

Expand Down

0 comments on commit f4f6d53

Please sign in to comment.