Skip to content

Commit

Permalink
Workaround python/mypy#1153
Browse files Browse the repository at this point in the history
  • Loading branch information
toslunar committed Mar 11, 2022
1 parent afff3d5 commit 0c21181
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pfrl/wrappers/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@ class _Stub:
def __init__(self, *args, **kwargs):
raise RuntimeError("Monitor is not available in this version of gym")

class _GymMonitor(_Stub):
class _GymMonitor(_Stub): # type: ignore
pass

class _GymStatsRecorder(_Stub):
pass

else:
from gym.wrappers.monitoring.stats_recorder import (
StatsRecorder as _GymStatsRecorder,
)
from gym.wrappers.monitoring.stats_recorder import StatsRecorder as _GymStatsRecorder # type: ignore


class Monitor(_GymMonitor):
Expand Down

0 comments on commit 0c21181

Please sign in to comment.