Skip to content

Commit c54197a

Browse files
author
Chris Elion
authored
[Release 7] Improve environment finding logic on windows (#4485)
* look in subdirectory for win builds * exclude crashhandlers
1 parent 3625cc3 commit c54197a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ml-agents-envs/mlagents_envs/env_utils.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,16 @@ def validate_environment_path(env_path: str) -> Optional[str]:
6868
candidates = glob.glob(os.path.join(cwd, env_path + ".exe"))
6969
if len(candidates) == 0:
7070
candidates = glob.glob(env_path + ".exe")
71+
if len(candidates) == 0:
72+
# Look for e.g. 3DBall\UnityEnvironment.exe
73+
crash_handlers = set(
74+
glob.glob(os.path.join(cwd, env_path, "UnityCrashHandler*.exe"))
75+
)
76+
candidates = [
77+
c
78+
for c in glob.glob(os.path.join(cwd, env_path, "*.exe"))
79+
if c not in crash_handlers
80+
]
7181
if len(candidates) > 0:
7282
launch_string = candidates[0]
7383
return launch_string

0 commit comments

Comments
 (0)