From 304b699fbc6be717a6ece8c4717a044188ad1ebe Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Thu, 24 Mar 2022 23:23:22 +0530 Subject: [PATCH] Do not force translate to using `conda.bat` file if user has explicitly stated to use `conda.exe` --- .../pythonEnvironments/common/environmentManagers/conda.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/client/pythonEnvironments/common/environmentManagers/conda.ts b/src/client/pythonEnvironments/common/environmentManagers/conda.ts index cbc03e8698c4..db026f4cda05 100644 --- a/src/client/pythonEnvironments/common/environmentManagers/conda.ts +++ b/src/client/pythonEnvironments/common/environmentManagers/conda.ts @@ -269,11 +269,11 @@ export class Conda { private static async locate(): Promise { traceVerbose(`Searching for conda.`); const home = getUserHomeDir(); + const customCondaPath = getPythonSetting(CONDAPATH_SETTING_KEY); const suffix = getOSType() === OSType.Windows ? 'Scripts\\conda.exe' : 'bin/conda'; // Produce a list of candidate binaries to be probed by exec'ing them. async function* getCandidates() { - const customCondaPath = getPythonSetting(CONDAPATH_SETTING_KEY); if (customCondaPath && customCondaPath !== 'conda') { // If user has specified a custom conda path, use it first. yield customCondaPath; @@ -369,8 +369,9 @@ export class Conda { let conda = new Conda(condaPath); try { await conda.getInfo(); - if (getOSType() === OSType.Windows) { + if (getOSType() === OSType.Windows && (isTestExecution() || condaPath !== customCondaPath)) { // Prefer to use .bat files over .exe on windows as that is what cmd works best on. + // Do not translate to `.bat` file if the setting explicitly sets the executable. const condaBatFile = await getCondaBatFile(condaPath); try { if (condaBatFile) {