private @NotNull Promise<@Nullable RunContentDescriptor> executeWithLegacyWorkaround(
    @NotNull ExecutionEnvironment environment,
    @NotNull RunProfileState state
  ) throws ExecutionException {
    boolean callExecute = true;
    try {
      callExecute = getClass()
        .getDeclaredMethod("doExecute", RunProfileState.class, ExecutionEnvironment.class)
        .getDeclaringClass()
        .equals(PyDebugRunner.class);
    }
    catch (NoSuchMethodException e) {
      // It's not supposed to happen, but if it happens, asynchronous execute is called.
    }
    if (callExecute) {
      return execute(environment, state);
    }
    return AppUIExecutor.onUiThread().submit(() -> doExecute(state, environment));
  }
private @NotNull Promise<@Nullable RunContentDescriptor> executeWithLegacyWorkaround(
    @NotNull ExecutionEnvironment environment,
    @NotNull RunProfileState state
  )