Skip to content

Commit 1eb3033

Browse files
committed
Ensure cancellation is supported for conda env creation.
1 parent 84e3309 commit 1eb3033

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/client/pythonEnvironments/creation/provider/condaCreationProvider.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@ async function createEnvironment(options?: CreateEnvironmentOptions): Promise<Cr
192192
throw ex;
193193
}
194194

195+
if (version === undefined) {
196+
traceError('Python version was not selected for creating conda environment.');
197+
return MultiStepAction.Cancel;
198+
}
195199
return MultiStepAction.Continue;
196200
},
197201
undefined,

src/test/pythonEnvironments/creation/provider/condaCreationProvider.unit.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ suite('Conda Creation provider tests', () => {
7676
});
7777
pickPythonVersionStub.resolves(undefined);
7878

79-
assert.isUndefined(await condaProvider.createEnvironment());
79+
await assert.isRejected(condaProvider.createEnvironment());
8080
});
8181

8282
test('Create conda environment', async () => {

0 commit comments

Comments
 (0)