Mon, 11 Sep 2023 17:52:27 +0200
Corrected a little glitch in the VirtualenvManager code.
src/eric7/VirtualEnv/VirtualenvManager.py | file | annotate | diff | comparison | revisions |
--- a/src/eric7/VirtualEnv/VirtualenvManager.py Sun Sep 10 18:06:34 2023 +0200 +++ b/src/eric7/VirtualEnv/VirtualenvManager.py Mon Sep 11 17:52:27 2023 +0200 @@ -7,6 +7,7 @@ Module implementing a class to manage Python virtual environments. """ +import contextlib import copy import json import os @@ -106,11 +107,12 @@ # only check for a non-embedded environment found = False for venvName in self.__virtualEnvironments: - if os.path.samefile( - defaultPy, self.__virtualEnvironments[venvName].interpreter - ): - found = True - break + with contextlib.suppress(FileNotFoundError): + if os.path.samefile( + defaultPy, self.__virtualEnvironments[venvName].interpreter + ): + found = True + break if not found: # add an environment entry for the default interpreter self.__virtualEnvironments[