| 123 | |
| 124 | |
| 125 | def _win_install_needs_python_exe(conda_exe: str, conda_exe_type: StandaloneExe | None) -> bool: |
| 126 | if not conda_exe_type: |
| 127 | return True |
| 128 | results = subprocess.run( |
| 129 | [conda_exe, "constructor", "windows", "--help"], |
| 130 | capture_output=True, |
| 131 | check=False, |
| 132 | ) |
| 133 | # Argparse uses return code 2 if a subcommand does not exist |
| 134 | # If the windows subcommand does not exist, python.exe is still |
| 135 | # required in the base environment. |
| 136 | return results.returncode == 2 |
| 137 | |
| 138 | |
| 139 | # Validate frozen environments |