summaryrefslogtreecommitdiffstats
path: root/Lib/site.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/site.py')
-rw-r--r--Lib/site.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/Lib/site.py b/Lib/site.py
index abf4b52..92bd1cc 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -94,6 +94,12 @@ def _trace(message):
print(message, file=sys.stderr)
+def _warn(*args, **kwargs):
+ import warnings
+
+ warnings.warn(*args, **kwargs)
+
+
def makepath(*paths):
dir = os.path.join(*paths)
try:
@@ -619,7 +625,10 @@ def venv(known_paths):
elif key == 'home':
sys._home = value
- sys.prefix = sys.exec_prefix = site_prefix
+ if sys.prefix != site_prefix:
+ _warn(f'Unexpected value in sys.prefix, expected {site_prefix}, got {sys.prefix}', RuntimeWarning)
+ if sys.exec_prefix != site_prefix:
+ _warn(f'Unexpected value in sys.exec_prefix, expected {site_prefix}, got {sys.exec_prefix}', RuntimeWarning)
# Doing this here ensures venv takes precedence over user-site
addsitepackages(known_paths, [sys.prefix])