Skip to content

Commit 7bd0d10

Browse files
authored
Merge pull request #720 from compas-dev/fixrpc
Prepend libs to path
2 parents ffe178b + c6f3f84 commit 7bd0d10

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
### Changed
1313

14+
* Changed `compas._os.prepare_environment` to prepend environment paths (fixes problem with RPC on windows).
15+
1416
### Removed
1517

1618

src/compas/_os.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,13 @@ 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
224+
if is_windows():
225+
lib_bin = os.path.join(PYTHON_DIRECTORY, 'Library', 'bin')
226+
else:
227+
lib_bin = os.path.join(PYTHON_DIRECTORY, 'bin')
227228

228-
lib_bin = os.path.join(PYTHON_DIRECTORY, 'lib')
229229
if os.path.exists(lib_bin) and lib_bin not in env['PATH']:
230-
env['PATH'] += os.pathsep + lib_bin
230+
env['PATH'] = lib_bin + os.pathsep + env['PATH']
231231

232232
if CONDA_EXE:
233233
env['CONDA_EXE'] = CONDA_EXE

0 commit comments

Comments
 (0)