XDebugProcess (@NotNull final XDebugSession session) { myDebugProcess = new PyDebugProcess(session, serverSocket, myExecutionResult.getExecutionConsole(), myExecutionResult.getProcessHandler(), isMultiprocessDebug()); myDebugProcess.getProcessHandler().addProcessListener(new ProcessAdapter() { @Override public void onTextAvailable(@NotNull ProcessEvent event, @NotNull Key outputType) { myOutputBuilder.append(event.getText()); if (outputType == ProcessOutputType.STDERR) { myStdErrBuilder.append(event.getText()); } } @Override public void processTerminated(@NotNull ProcessEvent event) { myTerminateSemaphore.release(); if (event.getExitCode() != 0 && !myProcessCanTerminate) { Assert.fail("Process terminated unexpectedly\n" + myOutputBuilder); } } }); myDebugProcess.getProcessHandler().startNotify(); return myDebugProcess; }