Skip to content

Commit a1994ae

Browse files
committed
[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
1 parent 7e3507e commit a1994ae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lldb/test/API/lit.cfg.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import shlex
88
import shutil
99
import subprocess
10+
import sys
1011

1112
import lit.formats
1213

@@ -64,7 +65,7 @@ def find_python_interpreter():
6465

6566
# If we're running in a virtual environment, we already have a copy of the
6667
# Python executable.
67-
if "VIRTUAL_ENV" in config.environment:
68+
if sys.prefix != sys.base_prefix:
6869
return None
6970

7071
# Avoid doing any work if we already copied the binary.

0 commit comments

Comments
 (0)