Reads and returns the contents of the README.

    On failure, returns the project long description.

    Returns:
      The project's long description.

def long_description():
    """Reads and returns the contents of the README.

    On failure, returns the project long description.

    Returns:
      The project's long description.
    """
    cwd = os.path.abspath(os.path.dirname(__file__))
    readme_path = os.path.join(cwd, 'README.md')
    if not os.path.exists(readme_path):
        return pylink.__long_description__

    try:
        import pypandoc
        return pypandoc.convert(readme_path, 'rst')
    except (IOError, ImportError):
        pass

    return open(readme_path, 'r').read()