Skip to content

Commit a2f8ef5

Browse files
wouterhardemanawjuliani
authored andcommitted
Fixed issue with unity environment not being found on MacOS (#236)
If the internal executable can't be found, it will look for any file in the folder and run it.
1 parent 90ea762 commit a2f8ef5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

python/unityagents/environment.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ def __init__(self, file_name, worker_id=0,
7373
candidates = glob.glob(os.path.join(cwd, file_name + '.app', 'Contents', 'MacOS', true_filename))
7474
if len(candidates) == 0:
7575
candidates = glob.glob(os.path.join(file_name + '.app', 'Contents', 'MacOS', true_filename))
76+
if len(candidates) == 0:
77+
candidates = glob.glob(os.path.join(cwd, file_name + '.app', 'Contents', 'MacOS', '*'))
78+
if len(candidates) == 0:
79+
candidates = glob.glob(os.path.join(file_name + '.app', 'Contents', 'MacOS', '*'))
7680
if len(candidates) > 0:
7781
launch_string = candidates[0]
7882
elif platform == 'win32':

0 commit comments

Comments
 (0)