From 3d18aebe56383436dff3dbea7c75d491f8c7e201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AF=82=E6=9E=97?= <62745529+JilinJL@users.noreply.github.com> Date: Tue, 11 Mar 2025 16:34:00 +0800 Subject: [PATCH] Update passive_env_checker.py to fix "bool8 error" fix the bool8 error bool8 -> bool **I have tested the change and made sure it runs well** --- gym/utils/passive_env_checker.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gym/utils/passive_env_checker.py b/gym/utils/passive_env_checker.py index bd826510f48..15d43304695 100644 --- a/gym/utils/passive_env_checker.py +++ b/gym/utils/passive_env_checker.py @@ -222,19 +222,19 @@ def env_step_passive_checker(env, action): ) obs, reward, done, info = result - if not isinstance(done, (bool, np.bool8)): + if not isinstance(done, (bool, np.bool)): logger.warn( f"Expects `done` signal to be a boolean, actual type: {type(done)}" ) elif len(result) == 5: obs, reward, terminated, truncated, info = result - # np.bool is actual python bool not np boolean type, therefore bool_ or bool8 - if not isinstance(terminated, (bool, np.bool8)): + # np.bool is actual python bool not np boolean type, therefore bool_ or bool + if not isinstance(terminated, (bool, np.bool)): logger.warn( f"Expects `terminated` signal to be a boolean, actual type: {type(terminated)}" ) - if not isinstance(truncated, (bool, np.bool8)): + if not isinstance(truncated, (bool, np.bool)): logger.warn( f"Expects `truncated` signal to be a boolean, actual type: {type(truncated)}" )