aboutsummaryrefslogtreecommitdiff
path: root/lldb
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2024-06-17 10:20:52 -0700
committerJonas Devlieghere <jonas@devlieghere.com>2024-06-17 10:20:58 -0700
commita1994ae6247ddd0374c7eb3a5d421925117833ab (patch)
tree92c37fbdc29d940b31bce58197d9dde4aaabba6d /lldb
parent7e3507e2f565bfc63d4a3f098ab770dce842ed32 (diff)
downloadllvm-a1994ae6247ddd0374c7eb3a5d421925117833ab.zip
llvm-a1994ae6247ddd0374c7eb3a5d421925117833ab.tar.gz
llvm-a1994ae6247ddd0374c7eb3a5d421925117833ab.tar.bz2
[lldb] More reliably detect a virtual environment
More reliably detect whether the API tests are running in a virtual environment by comparing sys.prefix and sys.base_prefix [1]. [1] https://docs.python.org/3/library/sys.html#sys.base_prefix
Diffstat (limited to 'lldb')
-rw-r--r--lldb/test/API/lit.cfg.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lldb/test/API/lit.cfg.py b/lldb/test/API/lit.cfg.py
index 1e99c8c..48c5f49 100644
--- a/lldb/test/API/lit.cfg.py
+++ b/lldb/test/API/lit.cfg.py
@@ -7,6 +7,7 @@ import platform
import shlex
import shutil
import subprocess
+import sys
import lit.formats
@@ -64,7 +65,7 @@ def find_python_interpreter():
# If we're running in a virtual environment, we already have a copy of the
# Python executable.
- if "VIRTUAL_ENV" in config.environment:
+ if sys.prefix != sys.base_prefix:
return None
# Avoid doing any work if we already copied the binary.