Skip to content

Commit 178aa34

Browse files
committed
Fix for duplication of python envs
1 parent fb79afb commit 178aa34

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/client/pythonEnvironments/nativeAPI.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,10 +384,12 @@ class NativePythonEnvironments implements IDiscoveryAPI, Disposable {
384384
const info = toPythonEnvInfo(native);
385385
if (info) {
386386
const old = this._envs.find((item) => item.executable.filename === info.executable.filename);
387-
if (old && hasChanged(old, info)) {
387+
if (old) {
388388
this._envs = this._envs.filter((item) => item.executable.filename !== info.executable.filename);
389389
this._envs.push(info);
390-
this._onChanged.fire({ type: FileChangeType.Changed, old, new: info, searchLocation });
390+
if (hasChanged(old, info)) {
391+
this._onChanged.fire({ type: FileChangeType.Changed, old, new: info, searchLocation });
392+
}
391393
} else {
392394
this._envs.push(info);
393395
this._onChanged.fire({ type: FileChangeType.Created, new: info, searchLocation });

0 commit comments

Comments
 (0)