* @param errorP
   * @return Module
   */
  public static Module helpGetStellaModule(String pathname, boolean errorP) {
    if (Stella.stringEqlP(pathname, ((Module)(Stella.$MODULE$.get())).moduleFullName)) {
      return (((Module)(Stella.$MODULE$.get())));
    }
    { Context context = null;

      if (errorP) {
        context = Stella.helpGetStellaContextOrModule(pathname, true);
      }
      else {
        try {
          context = Stella.helpGetStellaContextOrModule(pathname, true);
        } catch (NoSuchContextException e000) {
          return (null);
        }
      }
      if (Stella_Object.isaP(context, Stella.SGT_STELLA_MODULE)) {
        return (((Module)(context)));
      }
      else if (errorP) {
        { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

          stream000.nativeStream.print("Context `" + context + "' is not a MODULE!");
          throw ((NoSuchContextException)(NoSuchContextException.newNoSuchContextException(stream000.theStringReader()).fillInStackTrace()));
        }
      }
      else {
        return (null);
      }
    }
  }