208 ericApp().getObject("Project") |
208 ericApp().getObject("Project") |
209 .getDebugProperty("VIRTUALENV") |
209 .getDebugProperty("VIRTUALENV") |
210 ) |
210 ) |
211 if not venvName: |
211 if not venvName: |
212 # fall back to interpreter used to run eric7 |
212 # fall back to interpreter used to run eric7 |
213 return sys.executable |
213 return Globals.getPythonExecutable() |
214 |
214 |
215 interpreter = ( |
215 interpreter = ( |
216 ericApp().getObject("VirtualEnvManager") |
216 ericApp().getObject("VirtualEnvManager") |
217 .getVirtualenvInterpreter(venvName) |
217 .getVirtualenvInterpreter(venvName) |
218 ) |
218 ) |
350 @rtype bool |
350 @rtype bool |
351 """ |
351 """ |
352 if not venvName: |
352 if not venvName: |
353 return False |
353 return False |
354 |
354 |
355 if self.getVirtualenvInterpreter(venvName) == sys.executable: |
355 if self.getVirtualenvInterpreter(venvName) in ( |
|
356 sys.executable, Globals.getPythonExecutable() |
|
357 ): |
356 upgradePyQt = self.__checkUpgradePyQt(packages) |
358 upgradePyQt = self.__checkUpgradePyQt(packages) |
357 upgradeEric = self.__checkUpgradeEric(packages) |
359 upgradeEric = self.__checkUpgradeEric(packages) |
358 if upgradeEric or upgradePyQt: |
360 if upgradeEric or upgradePyQt: |
359 try: |
361 try: |
360 if upgradeEric and upgradePyQt: |
362 if upgradeEric and upgradePyQt: |
959 args.append("--user-only") |
961 args.append("--user-only") |
960 if reverse: |
962 if reverse: |
961 args.append("--reverse") |
963 args.append("--reverse") |
962 |
964 |
963 proc = QProcess() |
965 proc = QProcess() |
964 proc.start(sys.executable.replace("w.exe", ".exe"), args) |
966 proc.start(Globals.getPythonExecutable(), args) |
965 if proc.waitForStarted(15000) and proc.waitForFinished(30000): |
967 if proc.waitForStarted(15000) and proc.waitForFinished(30000): |
966 output = str(proc.readAllStandardOutput(), |
968 output = str(proc.readAllStandardOutput(), |
967 Preferences.getSystem("IOEncoding"), |
969 Preferences.getSystem("IOEncoding"), |
968 'replace').strip() |
970 'replace').strip() |
969 with contextlib.suppress(json.JSONDecodeError): |
971 with contextlib.suppress(json.JSONDecodeError): |