forked from platformio/platformio-core
Improve detecting of Python EXE Path
This commit is contained in:
1 parent
023e2978ba
commit
f8e70c9362
6 files changed
+23
-24
No files matched your search
+15
-1
@@ -22,7 +22,7 @@ import subprocess
|
||||
import sys
|
||||
from glob import glob
|
||||
from os.path import (abspath, basename, dirname, expanduser, isdir, isfile,
|
||||
join, splitdrive)
|
||||
join, normpath, splitdrive)
|
||||
from platform import system, uname
|
||||
from shutil import rmtree
|
||||
from threading import Thread
|
||||
@@ -299,6 +299,16 @@ def exec_command(*args, **kwargs):
|
||||
return result
|
||||
|
||||
|
||||
def copy_pythonpath_to_osenv():
|
||||
_PYTHONPATH = []
|
||||
if "PYTHONPATH" in os.environ:
|
||||
_PYTHONPATH = os.environ.get("PYTHONPATH").split(os.pathsep)
|
||||
for p in os.sys.path:
|
||||
if p not in _PYTHONPATH:
|
||||
_PYTHONPATH.append(p)
|
||||
os.environ['PYTHONPATH'] = os.pathsep.join(_PYTHONPATH)
|
||||
|
||||
|
||||
def get_serialports():
|
||||
try:
|
||||
from serial.tools.list_ports import comports
|
||||
@@ -446,6 +456,10 @@ def get_frameworks(type_=None):
|
||||
return frameworks
|
||||
|
||||
|
||||
def get_pythonexe_path():
|
||||
return os.environ.get("PYTHONEXEPATH", normpath(sys.executable))
|
||||
|
||||
|
||||
def where_is_program(program, envpath=None):
|
||||
env = os.environ
|
||||
if envpath:
|
||||
|
||||
Reference in new issue
Block a user