def METHOD_NAME(cls, prompt):
    try:
        pw = METHOD_NAME.METHOD_NAME(prompt)
    except EOFError:
        if prompt:
            print()  # avoid err msg appearing right of prompt
        msg = []
        for env_var in "BORG_PASSPHRASE", "BORG_PASSCOMMAND":
            env_var_set = os.environ.get(env_var) is not None
            msg.append("{} is {}.".format(env_var, "set" if env_var_set else "not set"))
        msg.append("Interactive password query failed.")
        raise NoPassphraseFailure(" ".join(msg)) from None
    else:
        return cls(pw)