102 for venvName in envsToDelete: |
102 for venvName in envsToDelete: |
103 del environments[venvName] |
103 del environments[venvName] |
104 |
104 |
105 # check, if the interpreter used to run eric is in the environments |
105 # check, if the interpreter used to run eric is in the environments |
106 defaultPy = Globals.getPythonExecutable() |
106 defaultPy = Globals.getPythonExecutable() |
107 found = False |
107 if "{0}.venv{0}".format(os.sep) not in defaultPy: |
108 for venvName in self.__virtualEnvironments: |
108 # only check for a non-embedded environment |
109 if defaultPy == self.__virtualEnvironments[venvName]["interpreter"]: |
109 found = False |
110 found = True |
110 for venvName in self.__virtualEnvironments: |
111 break |
111 if defaultPy == self.__virtualEnvironments[venvName]["interpreter"]: |
112 if not found: |
112 found = True |
113 # add an environment entry for the default interpreter |
113 break |
114 self.__virtualEnvironments[VirtualenvManager.DefaultKey] = { |
114 if not found: |
115 "path": "", |
115 # add an environment entry for the default interpreter |
116 "interpreter": defaultPy, |
116 self.__virtualEnvironments[VirtualenvManager.DefaultKey] = { |
117 "variant": 3, |
117 "path": "", |
118 "is_global": True, |
118 "interpreter": defaultPy, |
119 "is_conda": False, |
119 "variant": 3, |
120 "is_remote": False, |
120 "is_global": True, |
121 "exec_path": "", |
121 "is_conda": False, |
122 } |
122 "is_remote": False, |
|
123 "exec_path": "", |
|
124 } |
123 |
125 |
124 self.__saveSettings() |
126 self.__saveSettings() |
125 |
127 |
126 def __saveSettings(self): |
128 def __saveSettings(self): |
127 """ |
129 """ |