summaryrefslogtreecommitdiff
path: root/src/plugins/python/pythonlanguageclient.cpp
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2022-06-15 13:10:26 +0200
committerDavid Schulz <david.schulz@qt.io>2022-06-27 11:23:54 +0000
commit1956fa03659bb4cd225cb66c712c0319615d0685 (patch)
tree00d7c8bd225aede76fb03822752f74ad74231870 /src/plugins/python/pythonlanguageclient.cpp
parente7d90c23b6275a56cb63ec40792faaa615003f67 (diff)
downloadqt-creator-1956fa03659bb4cd225cb66c712c0319615d0685.tar.gz
Python: prevent setting local env to remote pyls
Change-Id: Id0eea5420c897687e6931bf640e3a37ba2638b8f Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/python/pythonlanguageclient.cpp')
-rw-r--r--src/plugins/python/pythonlanguageclient.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/plugins/python/pythonlanguageclient.cpp b/src/plugins/python/pythonlanguageclient.cpp
index 2a4ea8c7d9..e621cd6283 100644
--- a/src/plugins/python/pythonlanguageclient.cpp
+++ b/src/plugins/python/pythonlanguageclient.cpp
@@ -153,14 +153,22 @@ class PyLSInterface : public StdIOClientInterface
public:
PyLSInterface()
: m_extraPythonPath("QtCreator-pyls-XXXXXX")
+ { }
+
+ TemporaryDirectory m_extraPythonPath;
+protected:
+ void startImpl() override
{
- Environment env = Environment::systemEnvironment();
- env.appendOrSet("PYTHONPATH",
- m_extraPythonPath.path().toString(),
- OsSpecificAspects::pathListSeparator(env.osType()));
- setEnvironment(env);
+ if (!m_cmd.executable().needsDevice()) {
+ // todo check where to put this tempdir in remote setups
+ Environment env = Environment::systemEnvironment();
+ env.appendOrSet("PYTHONPATH",
+ m_extraPythonPath.path().toString(),
+ OsSpecificAspects::pathListSeparator(env.osType()));
+ setEnvironment(env);
+ }
+ StdIOClientInterface::startImpl();
}
- TemporaryDirectory m_extraPythonPath;
};
PyLSClient *clientForPython(const FilePath &python)