Skip to content

Commit 56a38b0

Browse files
author
Kartik Raj
authored
Do not force translate to using conda.bat file if user has explicitly stated to use conda.exe (#18776)
1 parent fbd8763 commit 56a38b0

File tree

1 file changed

+3
-2
lines changed
  • src/client/pythonEnvironments/common/environmentManagers

1 file changed

+3
-2
lines changed

src/client/pythonEnvironments/common/environmentManagers/conda.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,11 @@ export class Conda {
269269
private static async locate(): Promise<Conda | undefined> {
270270
traceVerbose(`Searching for conda.`);
271271
const home = getUserHomeDir();
272+
const customCondaPath = getPythonSetting<string>(CONDAPATH_SETTING_KEY);
272273
const suffix = getOSType() === OSType.Windows ? 'Scripts\\conda.exe' : 'bin/conda';
273274

274275
// Produce a list of candidate binaries to be probed by exec'ing them.
275276
async function* getCandidates() {
276-
const customCondaPath = getPythonSetting<string>(CONDAPATH_SETTING_KEY);
277277
if (customCondaPath && customCondaPath !== 'conda') {
278278
// If user has specified a custom conda path, use it first.
279279
yield customCondaPath;
@@ -369,8 +369,9 @@ export class Conda {
369369
let conda = new Conda(condaPath);
370370
try {
371371
await conda.getInfo();
372-
if (getOSType() === OSType.Windows) {
372+
if (getOSType() === OSType.Windows && (isTestExecution() || condaPath !== customCondaPath)) {
373373
// Prefer to use .bat files over .exe on windows as that is what cmd works best on.
374+
// Do not translate to `.bat` file if the setting explicitly sets the executable.
374375
const condaBatFile = await getCondaBatFile(condaPath);
375376
try {
376377
if (condaBatFile) {

0 commit comments

Comments
 (0)