コード例 #1
0
ファイル: core.py プロジェクト: StanfordVL/ARPL
 def _check_for_duplicate_wrappers(self):
     """Raise an error if there are duplicate wrappers. Can be overwritten by subclasses"""
     if self.class_name() in [
             wrapper.class_name() for wrapper in self._wrapper_stack
     ]:
         raise error.DoubleWrapperError(
             "Attempted to double wrap with Wrapper: {}".format(
                 self.class_name()))
コード例 #2
0
ファイル: core.py プロジェクト: wangye777/gym
 def _ensure_no_double_wrap(self):
     env = self.env
     while True:
         if isinstance(env, Wrapper):
             if env.class_name() == self.class_name():
                 raise error.DoubleWrapperError("Attempted to double wrap with Wrapper: {}".format(self.__class__.__name__))
             env = env.env
         else:
             break