Explorar el Código

Merge branch 'bugfix/idf_tools_v4.0' into 'release/v4.0'

idf_tools.py bug fixes (backport v4.0)

See merge request espressif/esp-idf!7479
Ivan Grokhotkov hace 6 años
padre
commit
97ef8fd057
Se han modificado 1 ficheros con 6 adiciones y 0 borrados
  1. 6 0
      tools/idf_tools.py

+ 6 - 0
tools/idf_tools.py

@@ -1339,10 +1339,16 @@ def main(argv):
         global_idf_path = args.idf_path
     if not global_idf_path:
         global_idf_path = os.path.realpath(os.path.join(os.path.dirname(__file__), ".."))
+    os.environ['IDF_PATH'] = global_idf_path
 
     global global_idf_tools_path
     global_idf_tools_path = os.environ.get('IDF_TOOLS_PATH') or os.path.expanduser(IDF_TOOLS_PATH_DEFAULT)
 
+    # On macOS, unset __PYVENV_LAUNCHER__ variable if it is set.
+    # Otherwise sys.executable keeps pointing to the system Python, even when a python binary from a virtualenv is invoked.
+    # See https://bugs.python.org/issue22490#msg283859.
+    os.environ.pop('__PYVENV_LAUNCHER__', None)
+
     if sys.version_info.major == 2:
         try:
             global_idf_tools_path.decode('ascii')