@Deprecated(forRemoval = true)
  protected @NotNull RunContentDescriptor doExecute(@NotNull RunProfileState state, final @NotNull ExecutionEnvironment environment)
    throws ExecutionException {
    // The PyDebugRunner class might inherit AsyncProgramRunner, but some magic is added for backward compatibility
    // with GenericProgramRunner. Consider changing the base class when doExecute method is deleted.
    // Now the logic here is the same as in execute() except the fact that everything is called in EDT.
    FileDocumentManager.getInstance().saveAllDocuments();

    final PythonCommandLineState pyState = (PythonCommandLineState)state;
    Sdk sdk = pyState.getSdk();
    PyDebugSessionFactory sessionCreator = PyDebugSessionFactory.findExtension(sdk);
    final XDebugSession session;
    if (sessionCreator != null) {
      session = sessionCreator.createSession(pyState, environment);
    }
    else {
      final ServerSocket serverSocket = PythonCommandLineState.createServerSocket();
      final int serverLocalPort = serverSocket.getLocalPort();
      RunProfile profile = environment.getRunProfile();
      final ExecutionResult result =
        pyState.execute(environment.getExecutor(), createCommandLinePatchers(environment.getProject(), pyState, profile, serverLocalPort));

      session = createXDebugSession(environment, pyState, serverSocket, result);
    }
    initSession(session, state, environment.getExecutor());
    return session.getRunContentDescriptor();
  }
@Deprecated(forRemoval = true)
  protected @NotNull RunContentDescriptor doExecute(@NotNull RunProfileState state, final @NotNull ExecutionEnvironment environment)