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();
}
}
Aggregations