@@ -271,8 +271,15 @@ export class Conda {
271
271
readonly command : string ,
272
272
shellCommand ?: string ,
273
273
private readonly shellPath ?: string ,
274
- private readonly useWorkerThreads = inExperiment ( DiscoveryUsingWorkers . experiment ) ,
274
+ private readonly useWorkerThreads ?: boolean ,
275
275
) {
276
+ if ( this . useWorkerThreads === undefined ) {
277
+ try {
278
+ this . useWorkerThreads = inExperiment ( DiscoveryUsingWorkers . experiment ) ;
279
+ } catch {
280
+ this . useWorkerThreads = false ; // Temporarily support for legacy tests
281
+ }
282
+ }
276
283
this . shellCommand = shellCommand ?? command ;
277
284
onDidChangePythonSetting ( CONDAPATH_SETTING_KEY , ( ) => {
278
285
Conda . condaPromise = new Map < string | undefined , Promise < Conda | undefined > > ( ) ;
@@ -292,10 +299,14 @@ export class Conda {
292
299
*
293
300
* @return A Conda instance corresponding to the binary, if successful; otherwise, undefined.
294
301
*/
295
- private static async locate (
296
- shellPath ?: string ,
297
- useWorkerThreads = inExperiment ( DiscoveryUsingWorkers . experiment ) ,
298
- ) : Promise < Conda | undefined > {
302
+ private static async locate ( shellPath ?: string , useWorkerThreads ?: boolean ) : Promise < Conda | undefined > {
303
+ if ( useWorkerThreads === undefined ) {
304
+ try {
305
+ useWorkerThreads = inExperiment ( DiscoveryUsingWorkers . experiment ) ;
306
+ } catch {
307
+ useWorkerThreads = false ; // Temporarily support for legacy tests
308
+ }
309
+ }
299
310
traceVerbose ( `Searching for conda.` ) ;
300
311
const home = getUserHomeDir ( ) ;
301
312
let customCondaPath : string | undefined = 'conda' ;
0 commit comments