Skip to content

Commit 6de8325

Browse files
committed
Propagate full PYTHONPATH only for Windows
1 parent cd51f7c commit 6de8325

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

platformio/util.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,11 @@ def copy_pythonpath_to_osenv():
359359
if "PYTHONPATH" in os.environ:
360360
_PYTHONPATH = os.environ.get("PYTHONPATH").split(os.pathsep)
361361
for p in os.sys.path:
362-
if p not in _PYTHONPATH:
362+
conditions = [p not in _PYTHONPATH]
363+
if "windows" not in get_systype():
364+
conditions.append(
365+
isdir(join(p, "click")) or isdir(join(p, "platformio")))
366+
if all(conditions):
363367
_PYTHONPATH.append(p)
364368
os.environ['PYTHONPATH'] = os.pathsep.join(_PYTHONPATH)
365369

0 commit comments

Comments
 (0)