From 3011cf11309e2cd577321858208beea4bcf117e4 Mon Sep 17 00:00:00 2001 From: cedspam Date: Fri, 26 Jan 2018 09:29:39 +0000 Subject: [PATCH] avoid errors in some ide docs system there are some error linked to repeated import of this module in spyder, an env with the same id cannot be registered again --- examples/pybullet/gym/pybullet_envs/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/pybullet/gym/pybullet_envs/__init__.py b/examples/pybullet/gym/pybullet_envs/__init__.py index a605dafc4..361d8bf42 100644 --- a/examples/pybullet/gym/pybullet_envs/__init__.py +++ b/examples/pybullet/gym/pybullet_envs/__init__.py @@ -1,4 +1,10 @@ -from gym.envs.registration import registry, register, make, spec +import gym +from gym.envs.registration import registry, make, spec +def register(id,*args,**kvargs): + if id inĀ  registry.env_specs: + return + else: + return gym.envs.registration.register(id,*args,**kvargs) # ------------bullet-------------