eric7/VirtualEnv/VirtualenvManager.py

branch
eric7
changeset 9016
6f079c524e99
parent 8972
54816b8f740f
child 9140
6bbb4e047902
equal deleted inserted replaced
9015:dfeefad914ed 9016:6f079c524e99
17 from PyQt6.QtWidgets import QDialog 17 from PyQt6.QtWidgets import QDialog
18 18
19 from EricWidgets import EricMessageBox 19 from EricWidgets import EricMessageBox
20 from EricWidgets.EricApplication import ericApp 20 from EricWidgets.EricApplication import ericApp
21 21
22 import Globals
22 import Preferences 23 import Preferences
23 24
24 25
25 class VirtualenvManager(QObject): 26 class VirtualenvManager(QObject):
26 """ 27 """
99 # now remove unsupported environments 100 # now remove unsupported environments
100 for venvName in envsToDelete: 101 for venvName in envsToDelete:
101 del environments[venvName] 102 del environments[venvName]
102 103
103 # check, if the interpreter used to run eric is in the environments 104 # check, if the interpreter used to run eric is in the environments
104 defaultPy = sys.executable.replace("w.exe", ".exe") 105 defaultPy = Globals.getPythonExecutable()
105 found = False 106 found = False
106 for venvName in self.__virtualEnvironments: 107 for venvName in self.__virtualEnvironments:
107 if (defaultPy == 108 if (defaultPy ==
108 self.__virtualEnvironments[venvName]["interpreter"]): 109 self.__virtualEnvironments[venvName]["interpreter"]):
109 found = True 110 found = True
511 @type str 512 @type str
512 @return interpreter path 513 @return interpreter path
513 @rtype str 514 @rtype str
514 """ 515 """
515 if venvName in self.__virtualEnvironments: 516 if venvName in self.__virtualEnvironments:
516 return self.__virtualEnvironments[venvName]["interpreter"] 517 return (
518 self.__virtualEnvironments[venvName]["interpreter"]
519 .replace("w.exe", ".exe")
520 )
517 else: 521 else:
518 return "" 522 return ""
519 523
520 def getVirtualenvDirectory(self, venvName): 524 def getVirtualenvDirectory(self, venvName):
521 """ 525 """

eric ide

mercurial