mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Pass shell environment before obtaining virtualenv environment for script execution (PY-17816)
If an IDE is executed not terminal on macOS it doesn't get shell environment and this prevents getting the correct environment by virtualenv activation
This commit is contained in:
@@ -67,6 +67,11 @@ class PyVirtualEnvReader(val virtualEnvSdkPath: String) : EnvironmentUtil.ShellE
|
||||
}
|
||||
}
|
||||
|
||||
override fun dumpProcessEnvToFile(command: MutableList<String>, envFile: File, lineSeparator: String?): MutableMap<String, String> {
|
||||
// pass shell environment for correct virtualenv environment setup (virtualenv expects to be executed from the terminal)
|
||||
return runProcessAndReadEnvs(command, null, EnvironmentUtil.getEnvironmentMap(), envFile, lineSeparator)
|
||||
}
|
||||
|
||||
private fun readVirtualEnvOnWindows(activate: Pair<String, String?>): MutableMap<String, String> {
|
||||
val activateFile = FileUtil.createTempFile("pycharm-virualenv-activate.", ".bat", false)
|
||||
val envFile = FileUtil.createTempFile("pycharm-virualenv-envs.", ".tmp", false)
|
||||
|
||||
Reference in New Issue
Block a user