Search in sources :

Example 1 with PyRemoteProcessHandlerBase

use of com.jetbrains.python.remote.PyRemoteProcessHandlerBase in project intellij-community by JetBrains.

the class PyRemoteProcessStarter method startRemoteProcess.

public ProcessHandler startRemoteProcess(@NotNull Sdk sdk, @NotNull GeneralCommandLine commandLine, @Nullable Project project, @Nullable PyRemotePathMapper pathMapper) throws ExecutionException {
    PythonRemoteInterpreterManager manager = PythonRemoteInterpreterManager.getInstance();
    if (manager != null) {
        PyRemoteProcessHandlerBase processHandler;
        try {
            processHandler = doStartRemoteProcess(sdk, commandLine, manager, project, pathMapper);
        } catch (ExecutionException e) {
            final Application application = ApplicationManager.getApplication();
            if (application != null && (application.isUnitTestMode() || application.isHeadlessEnvironment())) {
                throw new RuntimeException(e);
            }
            throw new ExecutionException("Can't run remote python interpreter: " + e.getMessage(), e);
        }
        ProcessTerminatedListener.attach(processHandler);
        return processHandler;
    } else {
        throw new PythonRemoteInterpreterManager.PyRemoteInterpreterExecutionException();
    }
}
Also used : PyRemoteProcessHandlerBase(com.jetbrains.python.remote.PyRemoteProcessHandlerBase) ExecutionException(com.intellij.execution.ExecutionException) PythonRemoteInterpreterManager(com.jetbrains.python.remote.PythonRemoteInterpreterManager) Application(com.intellij.openapi.application.Application)

Aggregations

ExecutionException (com.intellij.execution.ExecutionException)1 Application (com.intellij.openapi.application.Application)1 PyRemoteProcessHandlerBase (com.jetbrains.python.remote.PyRemoteProcessHandlerBase)1 PythonRemoteInterpreterManager (com.jetbrains.python.remote.PythonRemoteInterpreterManager)1