@@ -641,12 +641,9 @@ def search_up(prefix, *landmarks, test=isfile):
641
641
642
642
# For a venv, update the main prefix/exec_prefix but leave the base ones unchanged
643
643
if venv_prefix :
644
- if not prefix :
645
- base_prefix = prefix
646
- prefix = venv_prefix
647
- if not exec_prefix :
648
- base_exec_prefix = exec_prefix
649
- exec_prefix = venv_prefix
644
+ base_prefix = prefix
645
+ base_exec_prefix = exec_prefix
646
+ prefix = exec_prefix = venv_prefix
650
647
651
648
652
649
# After calculating prefix and exec_prefix, use their values for base_prefix and
@@ -761,12 +758,12 @@ def search_up(prefix, *landmarks, test=isfile):
761
758
# QUIRK: Non-Windows replaces prefix/exec_prefix with defaults when running
762
759
# in build directory. This happens after pythonpath calculation.
763
760
# Virtual environments using the build directory Python still keep their prefix.
764
- if os_name != 'nt' and build_prefix :
765
- base_prefix = config .get ('base_prefix' ) or PREFIX
766
- base_exec_prefix = config .get ('base_exec_prefix' ) or EXEC_PREFIX or prefix
761
+ if not venv_prefix and os_name != 'nt' and build_prefix :
767
762
if not venv_prefix :
768
- prefix = config .get ('prefix' ) or base_prefix
769
- exec_prefix = config .get ('exec_prefix' ) or base_exec_prefix
763
+ prefix = config .get ('prefix' ) or PREFIX
764
+ exec_prefix = config .get ('exec_prefix' ) or EXEC_PREFIX or prefix
765
+ base_prefix = config .get ('base_prefix' ) or prefix
766
+ base_exec_prefix = config .get ('base_exec_prefix' ) or base_prefix
770
767
771
768
772
769
# ******************************************************************************
0 commit comments