108 defaultPy = PythonUtilities.getPythonExecutable() |
108 defaultPy = PythonUtilities.getPythonExecutable() |
109 if "{0}.venv{0}".format(os.sep) not in defaultPy: |
109 if "{0}.venv{0}".format(os.sep) not in defaultPy: |
110 # only check for a non-embedded environment |
110 # only check for a non-embedded environment |
111 found = False |
111 found = False |
112 for venvName in self.__virtualEnvironments: |
112 for venvName in self.__virtualEnvironments: |
113 with contextlib.suppress(FileNotFoundError): |
113 interpreter = self.__virtualEnvironments[venvName].interpreter |
114 if os.path.samefile( |
114 with contextlib.suppress(OSError): |
115 defaultPy, self.__virtualEnvironments[venvName].interpreter |
115 if ( |
|
116 not FileSystemUtilities.isRemoteFileName(interpreter) |
|
117 and os.path.samefile(defaultPy, interpreter) |
116 ): |
118 ): |
117 found = True |
119 found = True |
118 break |
120 break |
119 if not found: |
121 if not found: |
120 # add an environment entry for the default interpreter |
122 # add an environment entry for the default interpreter |