Skip to content

Commit 50451de

Browse files
committed
Prepend libs to path
1 parent b9f1a2a commit 50451de

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/compas/_os.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,15 @@ def prepare_environment(env=None):
221221
env = os.environ.copy()
222222

223223
if PYTHON_DIRECTORY:
224-
lib_bin = os.path.join(PYTHON_DIRECTORY, 'Library', 'bin')
225-
if os.path.exists(lib_bin) and lib_bin not in env['PATH']:
226-
env['PATH'] += os.pathsep + lib_bin
227-
228-
lib_bin = os.path.join(PYTHON_DIRECTORY, 'lib')
229-
if os.path.exists(lib_bin) and lib_bin not in env['PATH']:
230-
env['PATH'] += os.pathsep + lib_bin
224+
if is_windows():
225+
lib_bin = os.path.join(PYTHON_DIRECTORY, 'Library', 'bin')
226+
if os.path.exists(lib_bin) and lib_bin not in env['PATH']:
227+
env['PATH'] = lib_bin + os.pathsep + env['PATH']
228+
229+
else:
230+
lib_bin = os.path.join(PYTHON_DIRECTORY, 'bin')
231+
if os.path.exists(lib_bin) and lib_bin not in env['PATH']:
232+
env['PATH'] = lib_bin + os.pathsep + env['PATH']
231233

232234
if CONDA_EXE:
233235
env['CONDA_EXE'] = CONDA_EXE

0 commit comments

Comments
 (0)