mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
QD-15453 Remove switching to EDT, remove preliminary acquiring write lock
GitOrigin-RevId: 364204a7692dedc11b437ec65202236d380cb953
This commit is contained in:
committed by
intellij-monorepo-bot
parent
1796e12d3c
commit
72231c88d2
@@ -1,7 +1,6 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.jetbrains.python.sdk
|
||||
|
||||
import com.intellij.openapi.application.writeAction
|
||||
import com.intellij.openapi.diagnostic.logger
|
||||
import com.intellij.openapi.module.Module
|
||||
import com.intellij.openapi.projectRoots.ProjectJdkTable
|
||||
@@ -41,12 +40,10 @@ object PySdkFromEnvironmentVariable {
|
||||
return findByPath(path)?.let { PyResult.success(it) } ?: createLocalSdkGuessingTypeByPath(path, moduleOrProject)
|
||||
}
|
||||
|
||||
suspend fun setModuleSdk(module: Module, projectSdk: Sdk?, sdk: Sdk, pythonPath: String) {
|
||||
fun setModuleSdk(module: Module, projectSdk: Sdk?, sdk: Sdk, pythonPath: String) {
|
||||
val moduleSdk = PythonSdkUtil.findPythonSdk(module)
|
||||
if (pythonPath != projectSdk?.homePath || pythonPath != moduleSdk?.homePath) {
|
||||
writeAction {
|
||||
module.pythonSdk = sdk
|
||||
}
|
||||
module.pythonSdk = sdk
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user