Skip to content

Commit 54fd4ae

Browse files
authored
Revert changes introduced for Native Locator (#23663)
1 parent c879780 commit 54fd4ae

File tree

2 files changed

+1
-44
lines changed

2 files changed

+1
-44
lines changed

src/client/pythonEnvironments/base/info/environmentInfoService.ts

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,6 @@ export interface IEnvironmentInfoService {
3030
env: PythonEnvInfo,
3131
priority?: EnvironmentInfoServiceQueuePriority,
3232
): Promise<InterpreterInformation | undefined>;
33-
/**
34-
* Get the mandatory interpreter information for the given environment.
35-
* E.g. executable path, version and sysPrefix are considered mandatory.
36-
* However if we only have part of the version, thats still sufficient.
37-
* If the fully resolved and acurate information for all parts of the env is required, then
38-
* used `getEnvironmentInfo`.
39-
* @param env The environment to get the interpreter information for.
40-
* @param priority The priority of the request.
41-
*/
42-
getMandatoryEnvironmentInfo(
43-
env: PythonEnvInfo,
44-
priority?: EnvironmentInfoServiceQueuePriority,
45-
): Promise<InterpreterInformation | undefined>;
4633
/**
4734
* Reset any stored interpreter information for the given environment.
4835
* @param searchLocation Search location of the environment.
@@ -137,36 +124,6 @@ class EnvironmentInfoService implements IEnvironmentInfoService {
137124
return deferred.promise;
138125
}
139126

140-
public async getMandatoryEnvironmentInfo(
141-
env: PythonEnvInfo,
142-
priority?: EnvironmentInfoServiceQueuePriority,
143-
): Promise<InterpreterInformation | undefined> {
144-
const interpreterPath = env.executable.filename;
145-
const result = this.cache.get(normCasePath(interpreterPath));
146-
if (result !== undefined) {
147-
// Another call for this environment has already been made, return its result.
148-
return result.promise;
149-
}
150-
151-
const deferred = createDeferred<InterpreterInformation>();
152-
const info = EnvironmentInfoService.getInterpreterInfo(env, true);
153-
if (info !== undefined) {
154-
this.cache.set(normCasePath(interpreterPath), deferred);
155-
deferred.resolve(info);
156-
return info;
157-
}
158-
159-
this.cache.set(normCasePath(interpreterPath), deferred);
160-
this._getEnvironmentInfo(env, priority)
161-
.then((r) => {
162-
deferred.resolve(r);
163-
})
164-
.catch((ex) => {
165-
deferred.reject(ex);
166-
});
167-
return deferred.promise;
168-
}
169-
170127
public async _getEnvironmentInfo(
171128
env: PythonEnvInfo,
172129
priority?: EnvironmentInfoServiceQueuePriority,

src/client/pythonEnvironments/base/locators/composite/envsResolver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export class PythonEnvsResolver implements IResolvingLocator {
137137
state.pending += 1;
138138
// It's essential we increment the pending call count before any asynchronus calls in this method.
139139
// We want this to be run even when `resolveInBackground` is called in background.
140-
const info = await this.environmentInfoService.getMandatoryEnvironmentInfo(seen[envIndex]);
140+
const info = await this.environmentInfoService.getEnvironmentInfo(seen[envIndex]);
141141
const old = seen[envIndex];
142142
if (info) {
143143
const resolvedEnv = getResolvedEnv(info, seen[envIndex], old.identifiedUsingNativeLocator);

0 commit comments

Comments
 (0)