Skip to content

Commit

Permalink
fix the two broken tests on circleci
Browse files Browse the repository at this point in the history
  • Loading branch information
BDonnot committed Jul 11, 2024
1 parent 0692f75 commit 4e4cdd7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions grid2op/Environment/baseEnv.py
Original file line number Diff line number Diff line change
Expand Up @@ -4086,9 +4086,11 @@ def _aux_gen_classes(cls_other, sys_path, _add_class_output=False):
env_path, env_nm = os.path.split(sub_repo)
if env_path not in sys.path:
sys.path.append(env_path)
if not package_path in sys.path:
sys.path.append(package_path)
super_supermodule = importlib.import_module(env_nm)
tmp_nm = f".{tmp_nm}"
sub_repo_mod = env_nm
nm_ = f"{tmp_nm}.{nm_}"
tmp_nm = env_nm
super_module = importlib.import_module(tmp_nm, package=sub_repo_mod)
add_sys_path = os.path.dirname(super_module.__file__)
if not add_sys_path in sys.path:
Expand All @@ -4097,7 +4099,6 @@ def _aux_gen_classes(cls_other, sys_path, _add_class_output=False):
if f"{tmp_nm}.{nm_}" in sys.modules:
cls_res = getattr(sys.modules[f"{tmp_nm}.{nm_}"], cls_other.__name__)
return str_import, cls_res

try:
module = importlib.import_module(f".{nm_}", package=tmp_nm)
except ModuleNotFoundError as exc_:
Expand Down

0 comments on commit 4e4cdd7

Please sign in to comment.