Compare commits

...

2 Commits

Author SHA1 Message Date
Guilhem Saurel
943f618dc5
Merge c25b563061 into 9b3eda0974 2024-09-20 14:40:34 +08:00
Guilhem Saurel
c25b563061 fix(tools): venv detection use VIRTUAL_ENV environ
To fix https://github.com/espressif/esp-idf/issues/12036
This is required for Nix "venv"-like way.
2024-08-24 13:40:02 +02:00

View File

@ -2574,7 +2574,7 @@ def action_install_python_env(args): # type: ignore
reinstall = args.reinstall
idf_python_env_path, _, virtualenv_python, idf_version = get_python_env_path()
is_virtualenv = hasattr(sys, 'real_prefix') or (hasattr(sys, 'base_prefix') and sys.base_prefix != sys.prefix)
is_virtualenv = 'VIRTUAL_ENV' in os.environ
if is_virtualenv and (not os.path.exists(idf_python_env_path) or reinstall):
fatal('This script was called from a virtual environment, can not create a virtual environment again')
raise SystemExit(1)