From 767d72a58b3bcb4097c8149c0ffc4c04bb8381bc Mon Sep 17 00:00:00 2001 From: Andrey Vlasovskikh Date: Thu, 15 Sep 2016 18:58:01 +0300 Subject: [PATCH] Disabled shell env loading on Linux due to exception (PY-15085) There is no printenv.py on Linux in the PyCharm distribution so PyCharm cannot read the environment variables. --- .../com/jetbrains/python/run/PyVirtualEnvReader.kt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/python/src/com/jetbrains/python/run/PyVirtualEnvReader.kt b/python/src/com/jetbrains/python/run/PyVirtualEnvReader.kt index aa94764afb37..41113ee1a867 100644 --- a/python/src/com/jetbrains/python/run/PyVirtualEnvReader.kt +++ b/python/src/com/jetbrains/python/run/PyVirtualEnvReader.kt @@ -33,18 +33,22 @@ class PyVirtualEnvReader(val virtualEnvSdkPath: String) : EnvironmentUtil.ShellE val activate = findActivateScript(virtualEnvSdkPath, shell) override fun readShellEnv(): MutableMap { - if (SystemInfo.isUnix) { + if (SystemInfo.isMac) { return super.readShellEnv() } - else { + else if (SystemInfo.isWindows) { if (activate != null) { - return readVirtualEnvOnWindows(activate); + return readVirtualEnvOnWindows(activate) } else { LOG.error("Can't find activate script for $virtualEnvSdkPath") - return mutableMapOf(); + return mutableMapOf() } } + else { + // TODO: Support shell env loading on Linux + return mutableMapOf() + } } private fun readVirtualEnvOnWindows(activate: String): MutableMap {